Commit d1834208 authored by Paul Slaughter's avatar Paul Slaughter

Add useFakeDate in test_setup

parent c26b7daf
......@@ -117,7 +117,7 @@ exports[`MergeRequestTable component template matches the snapshot 1`] = `
</li>
<li>
opened just now
opened 5 months ago
</li>
<li>
......
......@@ -58,8 +58,6 @@ describe('MergeRequestTable component', () => {
describe('template', () => {
beforeEach(() => {
jest.spyOn(global, 'Date').mockImplementationOnce(() => new Date('2020-03-09T11:01:58.135Z'));
bootstrap({ mergeRequests: mockMergeRequests });
});
......
......@@ -4,15 +4,12 @@ import NetworkPolicyList from 'ee/threat_monitoring/components/network_policy_li
import PolicyDrawer from 'ee/threat_monitoring/components/policy_editor/policy_drawer.vue';
import { PREDEFINED_NETWORK_POLICIES } from 'ee/threat_monitoring/constants';
import createStore from 'ee/threat_monitoring/store';
import { useFakeDate } from 'helpers/fake_date';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockPoliciesResponse } from '../mock_data';
const mockData = mockPoliciesResponse.map((policy) => convertObjectPropsToCamelCase(policy));
describe('NetworkPolicyList component', () => {
useFakeDate();
let store;
let wrapper;
......
......@@ -8,6 +8,7 @@ import { initializeTestTimeout } from './__helpers__/timeout';
import { getJSONFixture, loadHTMLFixture, setHTMLFixture } from './__helpers__/fixtures';
import { setupManualMocks } from './mocks/mocks_helper';
import customMatchers from './matchers';
import { useFakeDate } from './helpers/fake_date';
import './__helpers__/dom_shims';
import './__helpers__/jquery';
......@@ -20,6 +21,8 @@ process.on('unhandledRejection', global.promiseRejectionHandler);
setupManualMocks();
useFakeDate();
afterEach(() =>
// give Promises a bit more time so they fail the right test
new Promise(setImmediate).then(() => {
......
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