@@ -674,6 +675,24 @@ import { expect } from 'chai';
and then use them in your tests like you normally do.
### Initializing Test Environment
>Note: this feature is available with `react-scripts@0.4.0` and higher.
If your app uses a browser API that you need to mock in your tests or if you just need a global setup before running your tests, add a `src/setupTests.js` to your project. It will be automatically executed before running your tests.
For example:
#### `src/setupTests.js`
```js
constlocalStorageMock={
getItem:jest.fn(),
setItem:jest.fn(),
clear:jest.fn()
};
global.localStorage=localStorageMock
```
### Focusing and Excluding Tests
You can replace `it()` with `xit()` to temporarily exclude a test from being executed.