Skip to content

Commit

Permalink
Add support for testing with react@17
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustinLF committed Sep 14, 2022
1 parent 5e918d5 commit 80308d4
Show file tree
Hide file tree
Showing 5 changed files with 6,062 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
key: dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run: yarn setup:react:17
- persist_to_workspace:
root: .
paths:
Expand All @@ -49,6 +50,13 @@ jobs:
at: ~/react-native-testing-library
- run: |
yarn flow
test:react:17:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: |
yarn test:react:17
tests:
<<: *defaults
steps:
Expand Down Expand Up @@ -91,6 +99,9 @@ workflows:
- tests:
requires:
- install-dependencies
- test:react:17:
requires:
- install-dependencies
- test-website:
requires:
- install-dependencies
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
"build:ts": "tsc --build tsconfig.release.json",
"build:ts:watch": "yarn build:ts --watch --preserveWatchOutput",
"build": "yarn clean && yarn build:js && yarn build:ts && yarn copy-flowtypes",
"prepare": "yarn build"
"prepare": "yarn build",
"setup:react:17": "del react-17-tests/src react-17-tests/jest-preset && cp -R src jestSetup.js jest-preset babel.config.js react-17-tests/ && cd react-17-tests && yarn",
"test:react:17": "cd react-17-tests && yarn test"
},
"jest": {
"preset": "./jest-preset",
Expand All @@ -91,7 +93,8 @@
],
"testPathIgnorePatterns": [
"timerUtils",
"examples/"
"examples/",
"react-17-tests"
],
"testTimeout": 60000,
"transformIgnorePatterns": [
Expand Down
4 changes: 4 additions & 0 deletions react-17-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
jest-preset
jestSetup.js
babel.config.js
40 changes: 40 additions & 0 deletions react-17-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "react-17-tests",
"description": "Execute test suite with react@17",
"version": "0.0.1",
"private": true,
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-transform-flow-strip-types": "^7.18.0",
"@babel/preset-env": "^7.9.6",
"@babel/preset-flow": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"@babel/preset-typescript": "^7.16.0",
"@types/react-native": "~0.68.1",
"@types/react-test-renderer": "~17.0.2",
"@types/react": "~17.0.2",
"babel-jest": "^29.0.2",
"jest": "^29.0.2",
"react-native": "0.68.1",
"react-test-renderer": "~17.0.2",
"react": "17.0.2"
},
"scripts": {
"test": "jest"
},
"jest": {
"preset": "./jest-preset",
"setupFiles": [
"./jestSetup.js"
],
"testPathIgnorePatterns": [
"timerUtils"
],
"testTimeout": 60000,
"transformIgnorePatterns": [
"/node_modules/(?!(@react-native|react-native)/).*/"
]
}
}
Loading

0 comments on commit 80308d4

Please sign in to comment.