Skip to content

Commit c315d4d

Browse files
committed
Switch back to plain Jest
Since we're not testing multiple versions of React anymore, let's rip this stuff out to speed up the build process a tad.
1 parent 8719eda commit c315d4d

17 files changed

+14
-2080
lines changed

.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"plugin:react/recommended",
77
"plugin:prettier/recommended"
88
],
9+
"settings": {
10+
"react": {
11+
"version": "detect"
12+
}
13+
},
914
"parserOptions": {
1015
"ecmaVersion": 6,
1116
"sourceType": "module",

.gitignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
node_modules
2-
npm-debug.log
3-
.DS_Store
42
dist
53
lib
6-
.nyc_output
74
coverage
85
es
9-
test/**/lcov.info
10-
test/**/lcov-report
11-
test/react/*/test/**/*.spec.js
12-
test/react/**/src
13-
test/jest-config.json
14-
lcov.info
15-
.idea/
166

177
lib/core/metadata.js
188
lib/core/MetadataBlog.js

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22
node_js: node
33
cache: npm
4-
env:
5-
- REACT=16.8
64
script:
75
- npm test
86
after_success:

CONTRIBUTING.md

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -35,101 +35,21 @@ npm run build:umd:min
3535

3636
### Testing and Linting
3737

38-
To run the tests in the latest React version:
38+
To run the tests:
3939
```
4040
npm run test
4141
```
4242

43-
To run in explicit React versions (the number is the version, so `test:16.3` will run in React version `16.3`):
44-
```
45-
REACT=16.4 npm run test
46-
```
47-
48-
To run tests in all supported React versions, `16.4`, 16.5`,
49-
```
50-
REACT=all npm run test
51-
```
52-
5343
To continuously watch and run tests, run the following:
5444
```
55-
npm run test -- --watch
45+
npm test -- --watch
5646
```
5747

5848
To perform linting with `eslint`, run the following:
5949
```
6050
npm run lint
6151
```
6252

63-
#### Adding a new React version for testing
64-
65-
To add a new version of React to test react-redux against, create a directory structure
66-
in this format for React version `XX`:
67-
68-
```
69-
test/
70-
react/
71-
XX/
72-
package.json
73-
test/
74-
```
75-
76-
So, for example, to test against React 15.4:
77-
78-
79-
```
80-
test/
81-
react/
82-
15.4/
83-
package.json
84-
test/
85-
```
86-
87-
The package.json must include the correct versions of `react` & `react-dom`
88-
as well as the needed `create-react-class` like this:
89-
90-
```json
91-
{
92-
"private": true,
93-
"devDependencies": {
94-
"create-react-class": "^15.6.3",
95-
"react": "15.4",
96-
"react-dom": "15.4"
97-
}
98-
}
99-
```
100-
101-
Then you can run tests against this version with:
102-
103-
```
104-
REACT=15.4 npm run test
105-
```
106-
107-
and the new version will also be automatically included in
108-
109-
```
110-
REACT=all npm run test
111-
```
112-
113-
In addition, the new version should be added to the .travis.yml matrix list:
114-
115-
```yaml
116-
language: node_js
117-
node_js:
118-
- "8"
119-
before_install:
120-
- 'nvm install-latest-npm'
121-
env:
122-
matrix:
123-
- REACT=16.4
124-
- REACT=16.5
125-
sudo: false
126-
script:
127-
- npm run lint
128-
- npm run test
129-
after_success:
130-
- npm run coverage
131-
```
132-
13353
### New Features
13454

13555
Please open an issue with a proposal for a new feature or refactoring before starting on the work. We don't want you to waste your efforts on a pull request that we won't want to accept.

package-lock.json

Lines changed: 0 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"lint": "eslint src test/utils test/components",
3333
"prepare": "npm run clean && npm run build",
3434
"pretest": "npm run lint",
35-
"test": "node ./test/run-tests.js",
35+
"test": "jest",
3636
"coverage": "codecov"
3737
},
3838
"peerDependencies": {
@@ -62,7 +62,6 @@
6262
"codecov": "^3.3.0",
6363
"create-react-class": "^15.6.3",
6464
"cross-env": "^5.2.0",
65-
"cross-spawn": "^6.0.5",
6665
"es3ify": "^0.2.0",
6766
"eslint": "^5.16.0",
6867
"eslint-config-prettier": "^4.1.0",
@@ -72,7 +71,6 @@
7271
"glob": "^7.1.3",
7372
"jest": "^24.7.1",
7473
"jest-dom": "^3.1.3",
75-
"npm-run": "^5.0.1",
7674
"prettier": "^1.16.4",
7775
"react": "^16.8.6",
7876
"react-dom": "^16.8.6",
@@ -84,12 +82,16 @@
8482
"rollup-plugin-commonjs": "^9.3.3",
8583
"rollup-plugin-node-resolve": "^4.0.1",
8684
"rollup-plugin-replace": "^2.1.1",
87-
"rollup-plugin-terser": "^4.0.4",
88-
"semver": "^6.0.0"
85+
"rollup-plugin-terser": "^4.0.4"
8986
},
9087
"browserify": {
9188
"transform": [
9289
"loose-envify"
9390
]
91+
},
92+
"jest": {
93+
"coverageDirectory": "./coverage/",
94+
"collectCoverage": true,
95+
"testURL": "http://localhost"
9496
}
9597
}

test/babel-transformer.jest.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/install-test-deps.js

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)