Commit 7b1a5124 authored by Nathan Friend's avatar Nathan Friend

Merge branch 'vs-remove-use-fake-timers-from-jest' into 'master'

Remove jest.useFakeTimers from specs

See merge request gitlab-org/gitlab!30429
parents 62127458 94ec211c
......@@ -42,7 +42,6 @@ describe('Branches Select', () => {
};
beforeEach(() => {
jest.useFakeTimers();
jest
.spyOn(Api, 'projectProtectedBranches')
.mockReturnValue(Promise.resolve(TEST_PROTECTED_BRANCHES));
......
......@@ -152,7 +152,6 @@ describe('custom metrics form fields component', () => {
describe('when query validation is in flight', () => {
beforeEach(() => {
jest.useFakeTimers();
mountComponent(
{ metricPersisted: true, ...makeFormData({ query: 'validQuery' }) },
{
......
......@@ -70,14 +70,6 @@ describe('IDE clientside preview', () => {
});
};
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
afterEach(() => {
wrapper.destroy();
});
......
......@@ -62,9 +62,6 @@ describe('Monitoring store actions', () => {
beforeEach(() => {
mock = new MockAdapter(axios);
// Mock `backOff` function to remove exponential algorithm delay.
jest.useFakeTimers();
jest.spyOn(commonUtils, 'backOff').mockImplementation(callback => {
const q = new Promise((resolve, reject) => {
const stop = arg => (arg instanceof Error ? reject(arg) : resolve(arg));
......
......@@ -33,7 +33,6 @@ gl.utils.disableButtonIfEmptyField = () => {};
// eslint-disable-next-line jest/no-disabled-tests
describe.skip('Old Notes (~/notes.js)', () => {
beforeEach(() => {
jest.useFakeTimers();
loadFixtures(fixture);
// Re-declare this here so that test_setup.js#beforeEach() doesn't
......
......@@ -272,8 +272,6 @@ describe('Actions Notes Store', () => {
});
describe('poll', () => {
jest.useFakeTimers();
beforeEach(done => {
jest.spyOn(axios, 'get');
......
......@@ -3,8 +3,6 @@ import { assignIn } from 'lodash';
import waitForPromises from 'helpers/wait_for_promises';
import SmartInterval from '~/smart_interval';
jest.useFakeTimers();
let interval;
describe('SmartInterval', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment