forked from firefox-devtools/profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.js
27 lines (22 loc) · 956 Bytes
/
setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// @flow
import { cleanup } from 'react-testing-library';
jest.mock('../utils/worker-factory');
import * as WorkerFactory from '../utils/worker-factory';
afterEach(function() {
// This `__shutdownWorkers` function only exists in the mocked test environment,
// do not use flow typing on it.
const { __shutdownWorkers } = (WorkerFactory: Object);
__shutdownWorkers();
});
afterEach(cleanup);
afterEach(() => {
// The configuration to restore and reset all of the mocks in tests does not seem
// to be working correctly. Manually trigger this call here to ensure we
// don't get intermittents from one test's mocks affecting another test's mocks.
//
// See https://github.com/facebook/jest/issues/7654
jest.resetAllMocks();
});