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', () => { ...@@ -42,7 +42,6 @@ describe('Branches Select', () => {
}; };
beforeEach(() => { beforeEach(() => {
jest.useFakeTimers();
jest jest
.spyOn(Api, 'projectProtectedBranches') .spyOn(Api, 'projectProtectedBranches')
.mockReturnValue(Promise.resolve(TEST_PROTECTED_BRANCHES)); .mockReturnValue(Promise.resolve(TEST_PROTECTED_BRANCHES));
......
...@@ -152,7 +152,6 @@ describe('custom metrics form fields component', () => { ...@@ -152,7 +152,6 @@ describe('custom metrics form fields component', () => {
describe('when query validation is in flight', () => { describe('when query validation is in flight', () => {
beforeEach(() => { beforeEach(() => {
jest.useFakeTimers();
mountComponent( mountComponent(
{ metricPersisted: true, ...makeFormData({ query: 'validQuery' }) }, { metricPersisted: true, ...makeFormData({ query: 'validQuery' }) },
{ {
......
...@@ -70,14 +70,6 @@ describe('IDE clientside preview', () => { ...@@ -70,14 +70,6 @@ describe('IDE clientside preview', () => {
}); });
}; };
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
......
...@@ -62,9 +62,6 @@ describe('Monitoring store actions', () => { ...@@ -62,9 +62,6 @@ describe('Monitoring store actions', () => {
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
// Mock `backOff` function to remove exponential algorithm delay.
jest.useFakeTimers();
jest.spyOn(commonUtils, 'backOff').mockImplementation(callback => { jest.spyOn(commonUtils, 'backOff').mockImplementation(callback => {
const q = new Promise((resolve, reject) => { const q = new Promise((resolve, reject) => {
const stop = arg => (arg instanceof Error ? reject(arg) : resolve(arg)); const stop = arg => (arg instanceof Error ? reject(arg) : resolve(arg));
......
...@@ -33,7 +33,6 @@ gl.utils.disableButtonIfEmptyField = () => {}; ...@@ -33,7 +33,6 @@ gl.utils.disableButtonIfEmptyField = () => {};
// eslint-disable-next-line jest/no-disabled-tests // eslint-disable-next-line jest/no-disabled-tests
describe.skip('Old Notes (~/notes.js)', () => { describe.skip('Old Notes (~/notes.js)', () => {
beforeEach(() => { beforeEach(() => {
jest.useFakeTimers();
loadFixtures(fixture); loadFixtures(fixture);
// Re-declare this here so that test_setup.js#beforeEach() doesn't // Re-declare this here so that test_setup.js#beforeEach() doesn't
......
...@@ -272,8 +272,6 @@ describe('Actions Notes Store', () => { ...@@ -272,8 +272,6 @@ describe('Actions Notes Store', () => {
}); });
describe('poll', () => { describe('poll', () => {
jest.useFakeTimers();
beforeEach(done => { beforeEach(done => {
jest.spyOn(axios, 'get'); jest.spyOn(axios, 'get');
......
...@@ -3,8 +3,6 @@ import { assignIn } from 'lodash'; ...@@ -3,8 +3,6 @@ import { assignIn } from 'lodash';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import SmartInterval from '~/smart_interval'; import SmartInterval from '~/smart_interval';
jest.useFakeTimers();
let interval; let interval;
describe('SmartInterval', () => { 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