mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-03-30 17:04:14 +08:00
Document that src/setupTests.js doesn't work if created after ejecting
This commit is contained in:
@@ -1323,6 +1323,8 @@ import Adapter from 'enzyme-adapter-react-16';
|
||||
configure({ adapter: new Adapter() });
|
||||
```
|
||||
|
||||
(Note that **if you already ejected** before creating `src/setupTests.js`, this won’t work unless you set [this Jest option](https://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string) to point to `src/setupTests.js`.)
|
||||
|
||||
Now you can write a smoke test with it:
|
||||
|
||||
```js
|
||||
@@ -1412,6 +1414,8 @@ const localStorageMock = {
|
||||
global.localStorage = localStorageMock
|
||||
```
|
||||
|
||||
Note that **if you already ejected** before creating `src/setupTests.js`, this won’t work unless you set [this Jest option](https://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string) to point to `src/setupTests.js`.
|
||||
|
||||
### Focusing and Excluding Tests
|
||||
|
||||
You can replace `it()` with `xit()` to temporarily exclude a test from being executed.<br>
|
||||
|
||||
Reference in New Issue
Block a user