Skip to content

Commit afe3142

Browse files
committed
Merge branch 'main' into v14
# Conflicts: # .github/workflows/ci.yml # jest-setup.ts # package.json # src/__tests__/react-native-animated.test.tsx # src/__tests__/render-hook.test.tsx # src/__tests__/render.test.tsx # src/__tests__/wait-for.test.tsx # src/act.ts # src/fire-event.ts # src/helpers/__tests__/component-tree.test.tsx # src/helpers/accessibility.ts # src/helpers/component-tree.ts # src/helpers/debug.ts # src/helpers/find-all.ts # src/helpers/format.ts # src/helpers/host-component-names.ts # src/helpers/matchers/match-accessibility-state.ts # src/helpers/matchers/match-accessibility-value.ts # src/helpers/matchers/match-label-text.ts # src/helpers/matchers/match-text-content.ts # src/helpers/pointer-events.ts # src/helpers/string-validation.ts # src/helpers/text-input.ts # src/index.ts # src/matchers/__tests__/to-be-empty-element.test.tsx # src/matchers/__tests__/utils.test.tsx # src/matchers/to-be-busy.ts # src/matchers/to-be-checked.ts # src/matchers/to-be-disabled.ts # src/matchers/to-be-empty-element.ts # src/matchers/to-be-expanded.ts # src/matchers/to-be-on-the-screen.ts # src/matchers/to-be-partially-checked.ts # src/matchers/to-be-selected.ts # src/matchers/to-be-visible.ts # src/matchers/to-contain-element.ts # src/matchers/to-have-accessibility-value.ts # src/matchers/to-have-accessible-name.ts # src/matchers/to-have-display-value.ts # src/matchers/to-have-prop.ts # src/matchers/to-have-style.ts # src/matchers/to-have-text-content.ts # src/matchers/types.ts # src/matchers/utils.ts # src/native-state.ts # src/queries/display-value.ts # src/queries/hint-text.ts # src/queries/label-text.ts # src/queries/make-queries.ts # src/queries/placeholder-text.ts # src/queries/role.ts # src/queries/test-id.ts # src/queries/text.ts # src/queries/unsafe-props.ts # src/queries/unsafe-type.ts # src/render-act.ts # src/render.tsx # src/screen.ts # src/user-event/clear.ts # src/user-event/index.ts # src/user-event/paste.ts # src/user-event/press/press.ts # src/user-event/scroll/scroll-to.ts # src/user-event/setup/setup.ts # src/user-event/type/type.ts # src/user-event/utils/dispatch-event.ts # src/within.ts # yarn.lock
2 parents e905792 + 6dc9ae0 commit afe3142

File tree

232 files changed

+8082
-17646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+8082
-17646
lines changed

.codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ coverage:
33
round: down
44
range: 70...100
55
status:
6+
patch:
7+
default:
8+
target: 80% # Required patch coverage target
69
project:
710
default:
811
threshold: 0.5% # Allowable coverage drop in percentage points

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,21 @@ jobs:
6767
env:
6868
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6969

70-
test-website:
70+
test-react-18:
71+
needs: [install-cache-deps]
7172
runs-on: ubuntu-latest
72-
name: Test Website
73+
name: Test React 18
7374
steps:
7475
- name: Checkout
7576
uses: actions/checkout@v4
7677

77-
- name: Setup Node.js and website deps
78-
uses: ./.github/actions/setup-website-deps
78+
- name: Setup Node.js and deps
79+
uses: ./.github/actions/setup-deps
7980

80-
- name: Build website
81-
run: yarn --cwd website build
81+
- name: Switch to React 18
82+
run: |
83+
yarn remove react react-test-renderer react-native @react-native/babel-preset
84+
85+
86+
- name: Test
87+
run: yarn test:ci

.github/workflows/deploy-website.yml renamed to .github/workflows/website.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@ on:
44
push:
55
branches: [main]
66
paths: ['website/**']
7+
pull_request:
8+
branches: ['**']
9+
paths: ['website/**']
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ !contains(github.ref, 'main')}}
714

815
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
name: Test Website
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js and website deps
24+
uses: ./.github/actions/setup-website-deps
25+
26+
- name: Build website
27+
run: yarn --cwd website build
28+
929
deploy:
1030
name: Deploy to GitHub Pages
31+
if: github.ref == 'refs/heads/main'
1132
runs-on: ubuntu-latest
1233
steps:
1334
- name: Checkout
@@ -25,12 +46,11 @@ jobs:
2546
uses: peaceiris/actions-gh-pages@v3
2647
with:
2748
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
# Build output to publish to the `gh-pages` branch:
2949
publish_dir: ./website/build
3050
# The following lines assign commit authorship to the official
3151
# GH-Actions bot for deploys to `gh-pages` branch:
3252
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
3353
# The GH actions bot is used by default if you didn't specify the two fields.
3454
# You can swap them out with your own user credentials.
3555
user_name: github-actions[bot]
36-
user_email: 41898282+github-actions[bot]@users.noreply.github.com
56+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

.yarn/releases/yarn-4.4.0.cjs

Lines changed: 0 additions & 925 deletions
This file was deleted.

.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ enableGlobalCache: true
22

33
nodeLinker: node-modules
44

5-
yarnPath: .yarn/releases/yarn-4.4.0.cjs
5+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ When you're sending a pull request:
4949

5050
### Publishing a release
5151

52+
We use [release-it](https://github.com/release-it/release-it) to publish a release. It takes care of versioning, changelog generation, and publishing to NPM.
53+
5254
```sh
53-
yarn publish
55+
yarn release
5456
```
5557

56-
5. Push changes & tag to `origin`.
57-
5858
## Reporting issues
5959

6060
You can report issues on our [bug tracker](https://github.com/callstack/react-native-testing-library/issues). Please follow the issue template when opening an issue.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ React Native Testing Library consists of following APIs:
102102

103103
## Migration Guides
104104

105-
- [Migration to 12.0](https://callstack.github.io/react-native-testing-library/docs/migration/v12)
105+
- [Migration to 13.0](https://callstack.github.io/react-native-testing-library/docs/migration/v13)
106106
- [Migration to built-in Jest Matchers](https://callstack.github.io/react-native-testing-library/docs/migration/jest-matchers)
107107

108108
## Troubleshooting

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import tseslint from 'typescript-eslint';
2+
import callstackConfig from '@callstack/eslint-config/react-native.flat.js';
3+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
4+
5+
export default [
6+
{
7+
ignores: [
8+
'flow-typed/',
9+
'build/',
10+
'experiments-rtl/',
11+
'website/',
12+
'eslint.config.mjs',
13+
'jest-setup.ts',
14+
],
15+
},
16+
//...callstackConfig,
17+
// ...tseslint.configs.strict,
18+
// {
19+
// plugins: {
20+
// 'simple-import-sort': simpleImportSort,
21+
// },
22+
// rules: {
23+
// 'simple-import-sort/imports': [
24+
// 'error',
25+
// {
26+
// groups: [['^\\u0000', '^react', '^@?\\w', '^'], ['^\\.']],
27+
// },
28+
// ],
29+
// },
30+
// },
31+
// {
32+
// rules: {
33+
// 'no-console': 'error',
34+
// 'import/order': 'off',
35+
// '@typescript-eslint/consistent-type-imports': 'error',
36+
// },
37+
// },
38+
// {
39+
// files: ['**/*.test.{ts,tsx}', 'src/test-utils/**'],
40+
// rules: {
41+
// 'react/no-multi-comp': 'off',
42+
// 'react-native/no-color-literals': 'off',
43+
// 'react-native/no-inline-styles': 'off',
44+
// 'react-native/no-raw-text': 'off',
45+
// 'react-native-a11y/has-valid-accessibility-descriptors': 'off',
46+
// 'react-native-a11y/has-valid-accessibility-ignores-invert-colors': 'off',
47+
// 'react-native-a11y/has-valid-accessibility-value': 'off',
48+
// '@typescript-eslint/no-explicit-any': 'off',
49+
// },
50+
// },
51+
];

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('AnimatedView', () => {
2020
);
2121
expect(screen.root).toHaveStyle({ opacity: 0 });
2222

23-
await act(() => jest.advanceTimersByTime(250));
23+
act(() => jest.advanceTimersByTime(250));
2424
expect(screen.root).toHaveStyle({ opacity: 1 });
2525
});
2626

@@ -32,7 +32,7 @@ describe('AnimatedView', () => {
3232
);
3333
expect(screen.root).toHaveStyle({ opacity: 0 });
3434

35-
await act(() => jest.advanceTimersByTime(250));
35+
act(() => jest.advanceTimersByTime(250));
3636
expect(screen.root).toHaveStyle({ opacity: 1 });
3737
});
3838
});

examples/basic/jest-setup.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
import { configure } from '@testing-library/react-native';
2-
3-
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
4-
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');

examples/basic/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
preset: '@testing-library/react-native',
2+
preset: 'react-native',
33
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
44
setupFilesAfterEnv: ['./jest-setup.ts'],
55
};

examples/basic/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"expo": "^51.0.26",
15-
"expo-status-bar": "~1.12.1",
16-
"react": "18.2.0",
17-
"react-dom": "18.2.0",
18-
"react-native": "0.74.5",
19-
"react-native-web": "~0.19.6"
14+
"expo": "^52.0.23",
15+
"expo-status-bar": "~2.0.0",
16+
"react": "18.3.1",
17+
"react-dom": "18.3.1",
18+
"react-native": "0.76.5",
19+
"react-native-web": "~0.19.13"
2020
},
2121
"devDependencies": {
2222
"@babel/core": "^7.24.0",
23-
"@testing-library/react-native": "^13.0.0-alpha.1",
23+
"@testing-library/react-native": "^13.0.0",
2424
"@types/eslint": "^8.56.10",
2525
"@types/jest": "^29.5.12",
26-
"@types/react": "~18.2.79",
26+
"@types/react": "~18.3.12",
2727
"eslint": "^8.57.0",
2828
"jest": "^29.7.0",
2929
"react-test-renderer": "18.2.0",

0 commit comments

Comments
 (0)