-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[New] add enzyme-adapter-react-17
#2430
Open
layershifter
wants to merge
6
commits into
enzymejs:master
Choose a base branch
from
layershifter:feat/support-react17
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b6862d0
[New] add `enzyme-adapter-react-17`
ljharb d26a940
feat: add an adapter for React 17
layershifter 31178a0
add versions to CI
layershifter c6c9150
version updates
layershifter 8a6075b
offscreencomponent wip
ljharb 898978f
test TODOs
ljharb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.eslintignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../enzyme/.npmignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"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-reconciler": "^0.26.1", | ||
"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" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even
^1.14.0
(which is currentlylatest
) will throw peerDependency warnings due to requiringreact
0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0
.enzyme-adapter-utils
needs to have peerDependencies updated.airbnb-prop-types
needs to have peerDependencies updated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that is a bit tricky, since
airbnb-prop-types
also uses enzyme to test itself, and it can't really claim to support React 17 unless it tests on it.I'll be sure to update the peer deps for all the enzyme packages in this PR, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that needs to be much of a concern.
react
is only a peerDependency inairbnb-prop-types
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, which means that
npm ls
will fail when airbnb-prop-types and react 17 are installed, and npm 7+ will fail also.