Skip to content

Commit

Permalink
chore(deps): bump react to v17.x (#275)
Browse files Browse the repository at this point in the history
Co-authored-by: Gabe <[email protected]>
Co-authored-by: Jon Ursenbach <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2022
1 parent 5f28b8e commit eb29710
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 231 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [14.x, 16.x]
react: [16, 17]

name: build (${{ matrix.node-version }} w/ React ${{ matrix.react }}

steps:
- uses: actions/[email protected]
Expand All @@ -25,5 +28,19 @@ jobs:
- name: Install dependencies
run: npm ci

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

- name: Install React 16 Enzyme adapter
if: matrix.react == '16'
run: |
npm remove @wojtekmaj/enzyme-adapter-react-17
npm install enzyme-adapter-react-16
- name: Run tests on React 16
if: matrix.react == '16'
run: REACT_VERSION=16 npm test

- name: Run tests on React 17
if: matrix.react == '17'
run: npm test
10 changes: 9 additions & 1 deletion lib/enzyme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
/* eslint-disable import/no-extraneous-dependencies */
const Adapter = require('enzyme-adapter-react-16');
/* eslint-disable import/no-unresolved */
/* eslint-disable global-require */
const enzyme = require('enzyme');

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');
}

require('core-js/stable');
require('regenerator-runtime/runtime');

Expand Down
Loading

0 comments on commit eb29710

Please sign in to comment.