Skip to content

Commit 2ceb4b3

Browse files
committed
version updates
1 parent 34aba14 commit 2ceb4b3

File tree

7 files changed

+20
-12
lines changed

7 files changed

+20
-12
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ matrix:
101101
- node_js: "6"
102102
env: REACT=0.13
103103
env:
104-
- REACT=17.0
104+
- REACT=17.0.0-rc.0
105105
- REACT=16.13
106106
- REACT=16.12
107107
- REACT=16.11

env.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ function getAdapter(reactVersion) {
8686
return '16.1';
8787
}
8888
}
89+
// TODO: use Semver
90+
if (reactVersion === '17.0.0-rc.0') {
91+
return '17';
92+
}
8993
return null;
9094
}
9195
const reactVersion = version < 15 ? '0.' + version : version;

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.0.0-rc.0')) {
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-rc.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-rc.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-rc.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-rc.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-rc.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-rc.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-rc.0')) {
126126
({
127127
useCallback,
128128
useContext,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ export function is(range) {
1111
}
1212

1313
export const REACT16 = is('16');
14+
export const REACT17 = is('^17.0.0-rc.0');

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describeWithDOM('render', () => {
9494
});
9595

9696
const getWrapper = (options) => render(<StringComponent />, options);
97-
if (is('>= 16')) {
97+
if (is('>= 16 || ^17.0.0-rc.0')) {
9898
expect(getWrapper).to.not.throw();
9999

100100
const wrapper = getWrapper();
@@ -115,7 +115,7 @@ describeWithDOM('render', () => {
115115
});
116116

117117
const getWrapper = (options) => render(<NumberComponent />, options);
118-
if (is('>= 16')) {
118+
if (is('>= 16 || ^17.0.0-rc.0')) {
119119
expect(getWrapper).to.not.throw();
120120

121121
const wrapper = getWrapper();
@@ -129,7 +129,7 @@ describeWithDOM('render', () => {
129129
});
130130
});
131131

132-
describeIf(is('> 16.6'), 'suspense fallback option', () => {
132+
describeIf(is('> 16.6 || ^17.0.0-rc.0'), 'suspense fallback option', () => {
133133
it('throws if options.suspenseFallback is specified', () => {
134134
class DynamicComponent extends React.Component {
135135
render() {

0 commit comments

Comments
 (0)