Skip to content

Commit 3abeac3

Browse files
committed
Merge branch 'main' into v13
# Conflicts: # jest-setup.ts
2 parents 7455b21 + 0c8f3a8 commit 3abeac3

File tree

21 files changed

+142
-30
lines changed

21 files changed

+142
-30
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,26 @@ jobs:
5656
uses: ./.github/actions/setup-deps
5757

5858
- name: Test
59-
run: yarn test:ci
59+
run: yarn test:ci:coverage
6060

6161
- name: Upload coverage to Codecov
6262
uses: codecov/codecov-action@v4
6363

64+
65+
test-concurrent:
66+
needs: [install-cache-deps]
67+
runs-on: ubuntu-latest
68+
name: Test (concurrent mode)
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
73+
- name: Setup Node.js and deps
74+
uses: ./.github/actions/setup-deps
75+
76+
- name: Test in concurrent mode
77+
run: CONCURRENT_MODE=1 yarn test:ci
78+
6479
test-website:
6580
runs-on: ubuntu-latest
6681
name: Test Website

.release-it.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,47 @@
11
{
2+
"hooks": {
3+
"before:init": ["yarn typecheck", "yarn test", "yarn lint"],
4+
"after:bump": "yarn build",
5+
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
6+
},
27
"git": {
3-
"commitMessage": "chore: release ${version}",
8+
"commitMessage": "chore: release v${version}",
49
"tagName": "v${version}"
510
},
611
"npm": {
712
"publish": true
813
},
914
"github": {
10-
"release": true
15+
"release": true,
16+
"releaseName": "v${version}"
1117
},
1218
"plugins": {
1319
"@release-it/conventional-changelog": {
14-
"preset": "angular"
20+
"preset": {
21+
"name": "conventionalcommits",
22+
"types": [
23+
{
24+
"type": "feat",
25+
"section": "✨ Features"
26+
},
27+
{
28+
"type": "perf",
29+
"section": "💨 Performance Improvements"
30+
},
31+
{
32+
"type": "fix",
33+
"section": "🐛 Bug Fixes"
34+
},
35+
{
36+
"type": "chore(deps)",
37+
"section": "🛠️ Dependency Upgrades"
38+
},
39+
{
40+
"type": "docs",
41+
"section": "📚 Documentation"
42+
}
43+
]
44+
}
1545
}
1646
}
1747
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You can use the built-in Jest matchers automatically by having any import from `
4949
## Example
5050

5151
```jsx
52-
import { render, screen, fireEvent } from '@testing-library/react-native';
52+
import { render, screen, userEvent } from '@testing-library/react-native';
5353
import { QuestionsBoard } from '../QuestionsBoard';
5454

5555
// It is recommended to use userEvent with fake timers
@@ -105,7 +105,6 @@ React Native Testing Library consists of following APIs:
105105
- [Migration to 12.0](https://callstack.github.io/react-native-testing-library/docs/migration/v12)
106106
- [Migration to built-in Jest Matchers](https://callstack.github.io/react-native-testing-library/docs/migration/jest-matchers)
107107

108-
109108
## Troubleshooting
110109

111110
- [Troubleshooting guide](https://callstack.github.io/react-native-testing-library/docs/guides/troubleshooting)

examples/basic/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jest-setup.ts

examples/basic/components/AnimatedView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function AnimatedView(props: AnimatedViewProps) {
1717
duration: props.fadeInDuration ?? 250,
1818
useNativeDriver: props.useNativeDriver ?? true,
1919
}).start();
20-
}, [fadeAnim]);
20+
}, [fadeAnim, props.fadeInDuration, props.useNativeDriver]);
2121

2222
return (
2323
<Animated.View

examples/basic/components/__tests__/AnimatedView.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as React from 'react';
2+
import { Text } from 'react-native';
13
import { act, render, screen } from '@testing-library/react-native';
24
import { AnimatedView } from '../AnimatedView';
35

@@ -13,7 +15,7 @@ describe('AnimatedView', () => {
1315
it('should use native driver when useNativeDriver is true', async () => {
1416
render(
1517
<AnimatedView fadeInDuration={250} useNativeDriver={true}>
16-
Test
18+
<Text>Test</Text>
1719
</AnimatedView>,
1820
);
1921
expect(screen.root).toHaveStyle({ opacity: 0 });
@@ -25,7 +27,7 @@ describe('AnimatedView', () => {
2527
it('should not use native driver when useNativeDriver is false', async () => {
2628
render(
2729
<AnimatedView fadeInDuration={250} useNativeDriver={false}>
28-
Test
30+
<Text>Test</Text>
2931
</AnimatedView>,
3032
);
3133
expect(screen.root).toHaveStyle({ opacity: 0 });

examples/basic/jest-setup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/* eslint-disable no-undef, import/no-extraneous-dependencies */
1+
import { configure } from '@testing-library/react-native';
22

33
// Import built-in Jest matchers
44
import '@testing-library/react-native/extend-expect';
55

66
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
77
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
8+
9+
configure({ concurrentRoot: true });

examples/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"@babel/core": "^7.24.0",
23-
"@testing-library/react-native": "^12.7.1",
23+
"@testing-library/react-native": "^12.8.0",
2424
"@types/eslint": "^8.56.10",
2525
"@types/jest": "^29.5.12",
2626
"@types/react": "~18.2.79",

examples/basic/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,9 +2463,9 @@ __metadata:
24632463
languageName: node
24642464
linkType: hard
24652465

2466-
"@testing-library/react-native@npm:^12.7.1":
2467-
version: 12.7.1
2468-
resolution: "@testing-library/react-native@npm:12.7.1"
2466+
"@testing-library/react-native@npm:^12.8.0":
2467+
version: 12.8.0
2468+
resolution: "@testing-library/react-native@npm:12.8.0"
24692469
dependencies:
24702470
jest-matcher-utils: "npm:^29.7.0"
24712471
pretty-format: "npm:^29.7.0"
@@ -2478,7 +2478,7 @@ __metadata:
24782478
peerDependenciesMeta:
24792479
jest:
24802480
optional: true
2481-
checksum: 10c0/caaa4bdf97834b307b72af05c447ce40a2ba2ff40b464050bc29535caadf81981ea2873668445e633fdb3d13efccb136ef0932d6d9f4736bc6f7f98be98088d4
2481+
checksum: 10c0/216d40eefc3afa3259b37611213dcd6667cd0b8deb30521a8aaabe3afc15f07116ce64acba150f8c88b8e268df80639baf6bc38f05af1dbbae247e1d07639bde
24822482
languageName: node
24832483
linkType: hard
24842484

@@ -8923,7 +8923,7 @@ __metadata:
89238923
resolution: "root-workspace-0b6124@workspace:."
89248924
dependencies:
89258925
"@babel/core": "npm:^7.24.0"
8926-
"@testing-library/react-native": "npm:^12.7.1"
8926+
"@testing-library/react-native": "npm:^12.8.0"
89278927
"@types/eslint": "npm:^8.56.10"
89288928
"@types/jest": "npm:^29.5.12"
89298929
"@types/react": "npm:~18.2.79"

examples/cookbook/.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
test-utils.*
1+
jest-setup.ts
2+
test-utils.*

0 commit comments

Comments
 (0)