Skip to content

Commit

Permalink
version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter committed Aug 12, 2020
1 parent 34aba14 commit 2ceb4b3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ matrix:
- node_js: "6"
env: REACT=0.13
env:
- REACT=17.0
- REACT=17.0.0-rc.0
- REACT=16.13
- REACT=16.12
- REACT=16.11
Expand Down
4 changes: 4 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ function getAdapter(reactVersion) {
return '16.1';
}
}
// TODO: use Semver
if (reactVersion === '17.0.0-rc.0') {
return '17';
}
return null;
}
const reactVersion = version < 15 ? '0.' + version : version;
Expand Down
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.0.0-rc.0')) {
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-rc.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-rc.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-rc.0')) {
({ Fragment } = require('react'));
} else {
Fragment = null;
}

if (is('^16.3.0-0')) {
if (is('^16.3.0-0 || ^17.0.0-rc.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-rc.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-rc.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-rc.0')) {
({
useCallback,
useContext,
Expand Down
1 change: 1 addition & 0 deletions packages/enzyme-test-suite/test/_helpers/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export function is(range) {
}

export const REACT16 = is('16');
export const REACT17 = is('^17.0.0-rc.0');
6 changes: 3 additions & 3 deletions packages/enzyme-test-suite/test/staticRender-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describeWithDOM('render', () => {
});

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

const wrapper = getWrapper();
Expand All @@ -115,7 +115,7 @@ describeWithDOM('render', () => {
});

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

const wrapper = getWrapper();
Expand All @@ -129,7 +129,7 @@ describeWithDOM('render', () => {
});
});

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

0 comments on commit 2ceb4b3

Please sign in to comment.