mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-23 00:47:51 +00:00
17 lines
397 B
JavaScript
17 lines
397 B
JavaScript
const testTimeoutInMs = 0;
|
|
jest.setTimeout(testTimeoutInMs);
|
|
|
|
let testStartTime;
|
|
|
|
// https://github.com/facebook/jest/issues/6947
|
|
beforeEach(() => {
|
|
testStartTime = Date.now();
|
|
});
|
|
|
|
afterEach(() => {
|
|
const elapsedTimeInMs = Date.now() - testStartTime;
|
|
if (elapsedTimeInMs > testTimeoutInMs) {
|
|
throw new Error(`Test took too long (${elapsedTimeInMs}ms > ${testTimeoutInMs}ms)!`);
|
|
}
|
|
});
|