Unverified Commit 1c8a7f3f authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Document that src/setupTests.js doesn't work if created after ejecting

parent 21d0723d
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 4 additions and 0 deletions
+4 -0
......@@ -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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment