Skip to content

Commit

Permalink
version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and eps1lon committed Aug 2, 2022
1 parent 42fce4a commit 46de537
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions packages/enzyme-test-suite/test/_helpers/adapter.js
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
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
5 changes: 3 additions & 2 deletions packages/enzyme-test-suite/test/_helpers/version.js
Expand Up @@ -7,11 +7,12 @@ 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');

// 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.
export const BATCHING = !REACT16;
export const BATCHING = !REACT16 && !REACT17;

0 comments on commit 46de537

Please sign in to comment.