Skip to content

Commit 02fb6a5

Browse files
layershifterljharb
authored andcommitted
version updates
1 parent 6b19aef commit 02fb6a5

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ import describeMethods from './_helpers/describeMethods';
3939
import describeHooks from './_helpers/describeHooks';
4040
import {
4141
REACT16,
42+
REACT17,
4243
is,
4344
} from './_helpers/version';
4445

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

4950
describe('shallow', () => {
5051
describe('top level entry points', () => {

packages/enzyme-test-suite/test/_helpers/adapter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ if (process.env.ADAPTER) {
2727
Adapter = require('enzyme-adapter-react-16.3');
2828
} else if (is('^16.4.0-0')) {
2929
Adapter = require('enzyme-adapter-react-16');
30+
} else if (is('^17')) {
31+
Adapter = require('enzyme-adapter-react-17');
3032
}
3133

3234
module.exports = Adapter;

packages/enzyme-test-suite/test/_helpers/react-compat.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let useRef;
3636
let useState;
3737
let act;
3838

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

53-
if (is('^16.0.0-0 || ^16.3.0-0')) {
53+
if (is('^16.0.0-0 || ^16.3.0-0 || ^17.0.0')) {
5454
({ createPortal } = require('react-dom'));
5555
} else {
5656
createPortal = null;
@@ -62,13 +62,13 @@ if (is('>=15.3')) {
6262
PureComponent = null;
6363
}
6464

65-
if (is('^16.2.0-0')) {
65+
if (is('^16.2.0-0 || ^17.0.0')) {
6666
({ Fragment } = require('react'));
6767
} else {
6868
Fragment = null;
6969
}
7070

71-
if (is('^16.3.0-0')) {
71+
if (is('^16.3.0-0 || ^17.0.0')) {
7272
({
7373
createContext,
7474
createRef,
@@ -84,7 +84,7 @@ if (is('^16.3.0-0')) {
8484
AsyncMode = null;
8585
}
8686

87-
if (is('^16.9.0-0')) {
87+
if (is('^16.9.0-0 || ^17.0.0')) {
8888
({ Profiler } = require('react'));
8989
} else if (is('^16.4.0-0')) {
9090
({
@@ -94,7 +94,7 @@ if (is('^16.9.0-0')) {
9494
Profiler = null;
9595
}
9696

97-
if (is('^16.6.0-0')) {
97+
if (is('^16.6.0-0 || ^17.0.0')) {
9898
({
9999
Suspense,
100100
lazy,
@@ -122,7 +122,7 @@ if (is('^16.9.0-0')) {
122122
createRoot = null;
123123
}
124124

125-
if (is('^16.8.0-0')) {
125+
if (is('^16.8.0-0 || ^17.0.0')) {
126126
({
127127
useCallback,
128128
useContext,

packages/enzyme-test-suite/test/_helpers/version.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export function is(range) {
77
if (/&&/.test(range)) {
88
throw new RangeError('&& may not work properly in ranges, apparently');
99
}
10-
return semver.satisfies(VERSION, range);
10+
return semver.satisfies(VERSION, range, { includePrerelease: true });
1111
}
1212

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

0 commit comments

Comments
 (0)