Skip to content

v13 (rc) - React 18-19, uses React Test Renderer #1607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
398f09a
[v13] chore: remove deprecated stuff (#1603)
mdjastrzebski May 6, 2024
b797cf4
[v13] chore: remove react 16 & 17 code (#1602)
mdjastrzebski May 7, 2024
b5cfb98
[v13] chore: remove debug shallow (#1601)
mdjastrzebski May 8, 2024
450e750
[v13] chore: increase required React et al. versions
mdjastrzebski Aug 12, 2024
a3e1c5a
Merge branch 'main' into v13
mdjastrzebski Sep 5, 2024
e6d06a7
Merge branch 'main' into v13
mdjastrzebski Sep 12, 2024
c7f9132
Merge branch 'main' into v13
mdjastrzebski Oct 24, 2024
7455b21
feat: automatically extend matchers (#1684)
mdjastrzebski Oct 24, 2024
3abeac3
Merge branch 'main' into v13
mdjastrzebski Oct 25, 2024
383c241
feat(v13): enable concurrent rendering by default (#1692)
mdjastrzebski Oct 25, 2024
e90360b
refactor(v13): use react act if available (#1695)
mdjastrzebski Oct 25, 2024
1e788b6
chore: alpha release script
mdjastrzebski Oct 25, 2024
93eb539
chore: release v13.0.0-alpha.0
mdjastrzebski Oct 25, 2024
7905bb5
Merge branch 'main' into v13
mdjastrzebski Oct 31, 2024
13bc78a
refactor(v13): remove detect host component names (#1697)
mdjastrzebski Nov 4, 2024
a7404dc
Merge branch 'main' into v13
mdjastrzebski Nov 5, 2024
5a10b31
chore: change tsx to ts
mdjastrzebski Nov 5, 2024
83cafe4
refactor(v13): a11y label helpers (#1666)
mdjastrzebski Nov 5, 2024
f2de20c
chore: basic setup (#1659)
mdjastrzebski Nov 5, 2024
3f1d010
chore: release v13.0.0-alpha.1
mdjastrzebski Nov 5, 2024
71b059b
chore: update examples
mdjastrzebski Nov 5, 2024
868a9fc
Merge branch 'main' into v13
mdjastrzebski Nov 6, 2024
048d17d
chore(v13): remove jest preset (#1700)
mdjastrzebski Nov 6, 2024
2670b59
refactor(v13): cleanup existing code (#1701)
mdjastrzebski Nov 7, 2024
b402d14
chore: release v13.0.0-alpha.2
mdjastrzebski Nov 7, 2024
fec4c03
Merge branch 'main' into v13
mdjastrzebski Nov 7, 2024
b956cbc
chore: v13 beta
mdjastrzebski Nov 12, 2024
9ed7549
chore: release v13.0.0-beta.0
mdjastrzebski Nov 12, 2024
83716c2
Merge branch 'main' into v13
mdjastrzebski Nov 27, 2024
4f842f7
chore: fix example apps
mdjastrzebski Nov 27, 2024
1672880
chore: switch to RC
mdjastrzebski Dec 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"extends": "@callstack",
"rules": {
"react-native/no-raw-text": 0,
"no-console": 1,
"react/no-multi-comp": 0,
// Ignore certain webpack alias because it can't be resolved
"import/no-unresolved": [2, { "ignore": ["^@theme", "^@docusaurus", "^@generated"] }],
"react/no-multi-comp": 0,
"react-native/no-color-literals": "off",
"react-native/no-inline-styles": "off",
"react-native/no-raw-text": 0,
"react-native-a11y/has-valid-accessibility-descriptors": "off",
"react-native-a11y/has-valid-accessibility-ignores-invert-colors": 0,
"react-native-a11y/has-valid-accessibility-value": "off"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
test:
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Test
name: Test (concurrent)
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -67,19 +67,19 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-concurrent:
test-legacy:
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Test (concurrent mode)
name: Test (legacy)
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js and deps
uses: ./.github/actions/setup-deps

- name: Test in concurrent mode
run: CONCURRENT_MODE=1 yarn test:ci
- name: Test in legacy mode
run: CONCURRENT_MODE=0 yarn test:ci

test-website:
runs-on: ubuntu-latest
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ This library has a `peerDependencies` listing for `react-test-renderer`. Make su

### Additional Jest matchers

You can use the built-in Jest matchers by adding the following line to your `jest-setup.ts` file (configured using [`setupFilesAfterEnv`](https://jestjs.io/docs/configuration#setupfilesafterenv-array)):

```ts
import '@testing-library/react-native/extend-expect';
```
You can use the built-in Jest matchers automatically by having any import from `@testing-library/react-native` in your test.

## Example

Expand Down
11 changes: 7 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
module.exports = {
presets: [
'@babel/preset-typescript',
'@babel/preset-react',
[
'@babel/preset-env',
{
targets: {
node: '14',
node: '18',
},
bugfixes: true,
useBuiltIns: false,
modules: 'commonjs',
},
],
'@babel/preset-react',
'@babel/preset-typescript',
'@babel/preset-flow',
],
plugins: ['@babel/plugin-transform-strict-mode'],
env: {
test: {
presets: ['@react-native/babel-preset'],
Expand Down
6 changes: 0 additions & 6 deletions examples/basic/jest-setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
import { configure } from '@testing-library/react-native';

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

configure({ concurrentRoot: true });
2 changes: 1 addition & 1 deletion examples/basic/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
preset: '@testing-library/react-native',
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
setupFilesAfterEnv: ['./jest-setup.ts'],
};
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@testing-library/react-native": "^12.8.1",
"@testing-library/react-native": "^13.0.0-beta.0",
"@types/eslint": "^8.56.10",
"@types/jest": "^29.5.12",
"@types/react": "~18.3.12",
Expand Down
Loading
Loading