Update setTestTimeout documentation

This commit is contained in:
Luke Bennett 2019-03-12 03:00:12 +00:00 committed by Evan Read
parent 8f9189557d
commit b1184de452

View file

@ -35,15 +35,16 @@ If your test exceeds that time, it will fail.
If you cannot improve the performance of the tests, you can increase the timeout If you cannot improve the performance of the tests, you can increase the timeout
for a specific test using for a specific test using
[`jest.setTimeout`](https://jestjs.io/docs/en/jest-object#jestsettimeouttimeout). [`setTestTimeout`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec/frontend/helpers/timeout.js).
```javascript ```javascript
beforeAll(() => { import { setTestTimeout } from 'helpers/timeout';
jest.setTimeout(500);
});
describe('Component', () => { describe('Component', () => {
// ... it('does something amazing', () => {
setTestTimeout(500);
// ...
});
}); });
``` ```