@@ -45,10 +45,10 @@ To run in explicit React versions (the number is the version, so `test:16.3` wil
45
45
REACT=16.4 npm run test:ci
46
46
```
47
47
48
- To run tests in all supported React versions, ` 0.14 ` , ` 15 ` , ` 16.2 ` , ` 16.3 ` , ` 16.4 ` ,
48
+ To run tests in all supported React versions, ` 0.14 ` , ` 15 ` , ` 16.2 ` , ` 16.3 ` , ` 16.4 ` , 16.5`,
49
49
```
50
50
REACT=all npm run test:ci
51
- ```
51
+ ```
52
52
53
53
To continuously watch and run tests, run the following:
54
54
```
71
71
XX/
72
72
package.json
73
73
test/
74
- getTestDeps.js
75
74
```
76
75
77
76
So, for example, to test against React 15.4:
@@ -83,51 +82,22 @@ test/
83
82
15.4/
84
83
package.json
85
84
test/
86
- getTestDeps.js
87
85
```
88
86
89
- The package.json must include the correct versions of ` react ` , ` react-dom ` ,
90
- ` react-test-renderer ` and the correct enzyme adapter for the React version
91
- being used, as well as the needed ` create-react-class ` , ` jest ` , ` enzyme ` versions
92
- and the ` jest ` and ` scripts ` sections copied verbatim like this:
87
+ The package.json must include the correct versions of ` react ` & ` react-dom `
88
+ as well as the needed ` create-react-class ` like this:
93
89
94
90
``` json
95
91
{
96
92
"private" : true ,
97
93
"devDependencies" : {
98
94
"create-react-class" : " ^15.6.3" ,
99
- "enzyme" : " ^3.3.0" ,
100
- "enzyme-adapter-react-15.4" : " ^1.0.6" ,
101
- "jest" : " ^23.4.2" ,
102
95
"react" : " 15.4" ,
103
- "react-dom" : " 15.4" ,
104
- "react-test-renderer" : " 15.4"
105
- },
106
- "jest" : {
107
- "testURL" : " http://localhost" ,
108
- "collectCoverage" : true ,
109
- "coverageDirectory" : " ./coverage"
110
- },
111
- "scripts" : {
112
- "test" : " jest"
96
+ "react-dom" : " 15.4"
113
97
}
114
98
}
115
99
```
116
100
117
- ` getTestDeps.js ` should load the version-specific enzyme adapter and
118
- test renderer (all versions newer than 0.14 use ` react-test-renderer ` ,
119
- 0.14 uses ` react-addons-test-utils ` ):
120
-
121
- ``` js
122
- import enzyme from ' enzyme'
123
- import TestRenderer from ' react-test-renderer'
124
- import Adapter from ' enzyme-adapter-react-15.4'
125
-
126
- enzyme .configure ({ adapter: new Adapter () })
127
-
128
- export { TestRenderer , enzyme }
129
- ```
130
-
131
101
Then you can run tests against this version with:
132
102
133
103
```
156
126
- REACT=16.2
157
127
- REACT=16.3
158
128
- REACT=16.4
129
+ - REACT=16.5
159
130
sudo : false
160
131
script :
161
132
- npm run lint
0 commit comments