2021-11-23 07:14:32 -05:00
|
|
|
/* Setup for unit test environment */
|
2022-08-01 08:12:10 -04:00
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
|
|
import { setImmediate } from 'timers';
|
2021-11-23 07:14:32 -05:00
|
|
|
import 'helpers/shared_test_setup';
|
2021-02-10 10:11:19 -05:00
|
|
|
|
2019-03-25 16:32:48 -04:00
|
|
|
afterEach(() =>
|
|
|
|
// give Promises a bit more time so they fail the right test
|
2022-02-22 10:18:06 -05:00
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
2019-03-25 16:32:48 -04:00
|
|
|
new Promise(setImmediate).then(() => {
|
|
|
|
// wait for pending setTimeout()s
|
2020-04-03 20:09:37 -04:00
|
|
|
jest.runOnlyPendingTimers();
|
2019-03-25 16:32:48 -04:00
|
|
|
}),
|
|
|
|
);
|