Skip to content

Commit

Permalink
version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and ljharb committed Aug 12, 2020
1 parent 6b19aef commit 02fb6a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ import describeMethods from './_helpers/describeMethods';
import describeHooks from './_helpers/describeHooks';
import {
REACT16,
REACT17,
is,
} from './_helpers/version';

// The shallow renderer in react 16 does not yet support batched updates. When it does,
// we should be able to go un-skip all of the tests that are skipped with this flag.
const BATCHING = !REACT16;
const BATCHING = !REACT16 && !REACT17;

describe('shallow', () => {
describe('top level entry points', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/enzyme-test-suite/test/_helpers/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ if (process.env.ADAPTER) {
Adapter = require('enzyme-adapter-react-16.3');
} else if (is('^16.4.0-0')) {
Adapter = require('enzyme-adapter-react-16');
} else if (is('^17')) {
Adapter = require('enzyme-adapter-react-17');
}

module.exports = Adapter;
14 changes: 7 additions & 7 deletions packages/enzyme-test-suite/test/_helpers/react-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let useRef;
let useState;
let act;

if (is('>=15.5 || ^16.0.0-alpha || ^16.3.0-alpha')) {
if (is('>=15.5 || ^16.0.0-alpha || ^16.3.0-alpha || ^17.0.0')) {
// eslint-disable-next-line import/no-extraneous-dependencies
createClass = require('create-react-class');
} else {
Expand All @@ -50,7 +50,7 @@ if (is('^0.13.0')) {
({ renderToString } = require('react-dom/server'));
}

if (is('^16.0.0-0 || ^16.3.0-0')) {
if (is('^16.0.0-0 || ^16.3.0-0 || ^17.0.0')) {
({ createPortal } = require('react-dom'));
} else {
createPortal = null;
Expand All @@ -62,13 +62,13 @@ if (is('>=15.3')) {
PureComponent = null;
}

if (is('^16.2.0-0')) {
if (is('^16.2.0-0 || ^17.0.0')) {
({ Fragment } = require('react'));
} else {
Fragment = null;
}

if (is('^16.3.0-0')) {
if (is('^16.3.0-0 || ^17.0.0')) {
({
createContext,
createRef,
Expand All @@ -84,7 +84,7 @@ if (is('^16.3.0-0')) {
AsyncMode = null;
}

if (is('^16.9.0-0')) {
if (is('^16.9.0-0 || ^17.0.0')) {
({ Profiler } = require('react'));
} else if (is('^16.4.0-0')) {
({
Expand All @@ -94,7 +94,7 @@ if (is('^16.9.0-0')) {
Profiler = null;
}

if (is('^16.6.0-0')) {
if (is('^16.6.0-0 || ^17.0.0')) {
({
Suspense,
lazy,
Expand Down Expand Up @@ -122,7 +122,7 @@ if (is('^16.9.0-0')) {
createRoot = null;
}

if (is('^16.8.0-0')) {
if (is('^16.8.0-0 || ^17.0.0')) {
({
useCallback,
useContext,
Expand Down
3 changes: 2 additions & 1 deletion packages/enzyme-test-suite/test/_helpers/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function is(range) {
if (/&&/.test(range)) {
throw new RangeError('&& may not work properly in ranges, apparently');
}
return semver.satisfies(VERSION, range);
return semver.satisfies(VERSION, range, { includePrerelease: true });
}

export const REACT16 = is('16');
export const REACT17 = is('17');

0 comments on commit 02fb6a5

Please sign in to comment.