Skip to content

Commit

Permalink
[New] add enzyme-adapter-react-17
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb authored and eps1lon committed Aug 2, 2022
1 parent 3d286a4 commit e91c355
Show file tree
Hide file tree
Showing 20 changed files with 1,254 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
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
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
@@ -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
@@ -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
@@ -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 <ljharb@gmail.com>",
"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"
}
}

0 comments on commit e91c355

Please sign in to comment.