Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add enzyme-adapter-react-17 #2564

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e91c355
[New] add `enzyme-adapter-react-17`
ljharb Aug 10, 2020
0797375
feat: add an adapter for React 17
layershifter Aug 12, 2020
42fce4a
add versions to CI
layershifter Aug 12, 2020
46de537
version updates
layershifter Aug 12, 2020
13111be
offscreencomponent wip
ljharb Oct 26, 2020
1337f75
test TODOs
ljharb Jan 20, 2021
07504db
Remove TODO_17 tags
createthis Aug 10, 2021
75a15f4
Fix two failing tests by using less fragile syntax.
createthis Aug 10, 2021
658595a
Fix another test with fragile matching.
createthis Aug 10, 2021
9625c9f
componentWillReceiveProps and UNSAFE_componentWillReceiveProps removed
createthis Aug 10, 2021
7a54423
Fix shallow() so that it calls componentWillReceiveProps() and
createthis Aug 11, 2021
938d10a
Forgot a test case. Call componentWillReceiveProps() even when shallow
createthis Aug 11, 2021
bbab94b
displayNameOfNode gets a little wonky when used with React.memo and
createthis Aug 11, 2021
9a432a6
punt on the simulate failure. I worked on this all day yesterday and
createthis Aug 13, 2021
1f48ca9
Make a few changes I saw https://github.com/wojtekmaj requested in the
createthis Aug 13, 2021
ae9b14a
Add tip from https://github.com/ljharb to CONTRIBUTING
createthis Aug 13, 2021
935c84a
Restore suspense tests to the best of my ability.
createthis Aug 13, 2021
18d536f
createReactClass and React.Component pass the same check
eps1lon Aug 2, 2022
69f2846
Remove unused TODO_17
eps1lon Aug 2, 2022
5f2f0b1
Adjust displayname test to be invariant across React versions
eps1lon Aug 2, 2022
9dfd35f
Fix displayNameOfNode for Memo components
eps1lon Aug 2, 2022
cc64090
Fix isEmptyRender for SimpleMemoComponent
eps1lon Aug 3, 2022
762ac8c
Ensure Suspense tests are the same in 16 and 17
eps1lon Aug 3, 2022
cffae58
Remove React 16 logic that is no longer covered by tests
eps1lon Aug 3, 2022
7f309a1
Remove no obsolete "supports*" checks when detecting Fiber tags
eps1lon Aug 3, 2022
3b9b1e3
node_modules/.bin -> npx
eps1lon Aug 9, 2022
103174d
Revert .gitignore changes from base branch
eps1lon Aug 9, 2022
5418b9d
Remove outdated comment
eps1lon Aug 9, 2022
8649c0c
Simplify semver matcher for create-react-class
eps1lon Aug 9, 2022
8712dca
Merge branch 'master' into feat/support-react17-sebbie
eps1lon Oct 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[New] add enzyme-adapter-react-17
  • Loading branch information
ljharb authored and eps1lon committed Aug 2, 2022
commit e91c355de2b1bd4b1b2fc1c42a471f95353e4db1
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ matrix:
- node_js: "lts/*"
env: LINT=true
stage: test
- node_js: "8"
env: REACT=17
stage: test
- node_js: "8"
env: REACT=16
stage: test
- node_js: "6"
env: REACT=17
stage: test
- node_js: "6"
env: REACT=16
stage: test
Expand Down Expand Up @@ -112,6 +118,7 @@ matrix:
- node_js: "6"
env: REACT=0.13
env:
- REACT=17.0
- REACT=16.14
- REACT=16.13
- REACT=16.12
Expand Down
3 changes: 3 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function getAdapter(reactVersion) {
return '16.1';
}
}
if (semver.intersects(reactVersion, '^17.0.0')) {
return '17';
}
return null;
}
const reactVersion = version < 15 ? '0.' + version : version;
Expand Down
9 changes: 9 additions & 0 deletions packages/enzyme-adapter-react-17/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
["airbnb", { "transformRuntime": false }],
],
"plugins": [
["transform-replace-object-assign", { "moduleSpecifier": "object.assign" }],
],
"sourceMaps": "both",
}
1 change: 1 addition & 0 deletions packages/enzyme-adapter-react-17/.eslintignore
22 changes: 22 additions & 0 deletions packages/enzyme-adapter-react-17/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "airbnb",
"parser": "babel-eslint",
"root": true,
"rules": {
"max-classes-per-file": 0,
"max-len": 0,
"import/no-extraneous-dependencies": 2,
"import/no-unresolved": 2,
"import/extensions": 2,
"react/no-deprecated": 0,
"react/no-find-dom-node": 0,
"react/no-multi-comp": 0,
"no-underscore-dangle": 0,
"class-methods-use-this": 0
},
"settings": {
"react": {
"version": "17",
},
},
}
1 change: 1 addition & 0 deletions packages/enzyme-adapter-react-17/.npmignore
1 change: 1 addition & 0 deletions packages/enzyme-adapter-react-17/.npmrc
73 changes: 73 additions & 0 deletions packages/enzyme-adapter-react-17/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "enzyme-adapter-react-17",
"version": "0.0.0",
"description": "JavaScript Testing utilities for React",
"homepage": "https://enzymejs.github.io/enzyme/",
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel --source-maps=both src --out-dir build",
"watch": "npm run build -- -w",
"prepublish": "not-in-publish || (npm run build && safe-publish-latest && cp ../../{LICENSE,README}.md ./)"
},
"repository": {
"type": "git",
"url": "https://github.com/enzymejs/enzyme.git",
"directory": "packages/enzyme-adapter-react-17"
},
"keywords": [
"javascript",
"shallow rendering",
"shallowRender",
"test",
"reactjs",
"react",
"flux",
"testing",
"test utils",
"assertion helpers",
"tdd",
"mocha"
],
"author": "Jordan Harband <[email protected]>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"dependencies": {
"enzyme-adapter-utils": "^1.13.1",
"enzyme-shallow-equal": "^1.0.4",
"has": "^1.0.3",
"object.assign": "^4.1.0",
"object.values": "^1.1.1",
"prop-types": "^15.7.2",
"react-is": "^17.0.0",
"react-test-renderer": "^17.0.0",
"semver": "^5.7.0"
},
"peerDependencies": {
"enzyme": "^3.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-transform-replace-object-assign": "^2.0.0",
"babel-preset-airbnb": "^4.5.0",
"enzyme": "^3.0.0",
"eslint": "^7.6.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.8",
"in-publish": "^2.0.1",
"rimraf": "^2.7.1",
"safe-publish-latest": "^1.1.4"
}
}
Loading