Skip to content
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

chore(deps): bump react to v17.x #275

Merged
merged 15 commits into from
Mar 29, 2022
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ jobs:
run: npm ci

- name: Install React v${{ matrix.react-version }}
run: npm i react@${{ matrix.react-version }}
run: npm i react@${{ matrix.react-version react-dom@${{ matrix.react-version }}

- name: Install React 16 Enzyme adapter
if: matrix.react-version == '16.x'
run: |
npm remove @wojtekmaj/enzyme-adapter-react-17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this when we're doing React 16 because NPM might throw issues with it wanting React 17 to be around.

npm install enzyme-adapter-react-16

- name: Run tests
if: matrix.react-version == '16.x'
run: REACT_VERSION=16 npm test

- name: Run tests
run: npm test
if: matrix.react-version == '17.x'
run: REACT_VERSION=17 npm test
9 changes: 8 additions & 1 deletion lib/enzyme.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/* eslint-disable global-require */
/* eslint-disable import/no-extraneous-dependencies */
const enzyme = require('enzyme');
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17');

let Adapter;
if (process.env.REACT_VERSION && process.env.REACT_VERSION == '16') {
Adapter = require('enzyme-adapter-react-16');
} else {
Adapter = require('@wojtekmaj/enzyme-adapter-react-17');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


require('core-js/stable');
require('regenerator-runtime/runtime');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
},
"peerDependencies": {
"@readme/variable": "*",
"react": "16.x||17.x",
"react-dom": "16.x||17.x"
"react": "16.x || 17.x",
"react-dom": "16.x || 17.x"
},
"devDependencies": {
"@babel/preset-env": "^7.15.6",
Expand Down