Skip to content

Commit 7d8d28c

Browse files
authored
test: Run CI pipeline with React 16 and 17 (#690)
* feat: Support React 17 * No need to change peer dependency range
1 parent 3eb8387 commit 7d8d28c

File tree

4 files changed

+230
-8
lines changed

4 files changed

+230
-8
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ sudo: false
22
language: node_js
33
node_js:
44
- "12.19"
5+
env:
6+
- REACT_DIST=16
7+
- REACT_DIST=17
58
cache: yarn
69
install:
710
- yarn
11+
- yarn add react@$REACT_DIST react-dom@$REACT_DIST
812
- yarn --cwd www
913
script:
1014
- yarn test

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"devDependencies": {
6666
"@babel/cli": "^7.8.4",
6767
"@babel/core": "^7.9.0",
68+
"@eps1lon/enzyme-adapter-react-17": "^0.1.0",
6869
"@restart/hooks": "^0.3.22",
6970
"@semantic-release/changelog": "^5.0.1",
7071
"@semantic-release/git": "^9.0.0",
@@ -91,8 +92,8 @@
9192
"eslint-plugin-react-hooks": "^3.0.0",
9293
"jest": "^25.3.0",
9394
"prettier": "^2.0.4",
94-
"react": "^16.13.1",
95-
"react-dom": "^16.13.1",
95+
"react": "^17.0.1",
96+
"react-dom": "^17.0.1",
9697
"release-script": "^1.0.2",
9798
"rimraf": "^3.0.2",
9899
"rollup": "^2.6.1",

test/setup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ global.requestAnimationFrame = function(callback) {
55
};
66

77
const Enzyme = require('enzyme');
8-
const Adapter = require('enzyme-adapter-react-16');
8+
const Adapter16 = require('enzyme-adapter-react-16');
9+
const Adapter17 = require('@eps1lon/enzyme-adapter-react-17');
10+
11+
const Adapter = React.version.startsWith('16.') ? Adapter16 : Adapter17;
912

1013
Enzyme.configure({
1114
adapter: new Adapter(),

0 commit comments

Comments
 (0)