diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/frontend/test_setup.js | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/frontend/test_setup.js')
-rw-r--r-- | spec/frontend/test_setup.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index a122b06fdda..b6b29faef79 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -1,13 +1,13 @@ +import { config as testUtilsConfig } from '@vue/test-utils'; +import * as jqueryMatchers from 'custom-jquery-matchers'; import Vue from 'vue'; import 'jquery'; - -import * as jqueryMatchers from 'custom-jquery-matchers'; -import { config as testUtilsConfig } from '@vue/test-utils'; +import { setGlobalDateToFakeDate } from 'helpers/fake_date'; import Translate from '~/vue_shared/translate'; -import { initializeTestTimeout } from './__helpers__/timeout'; import { getJSONFixture, loadHTMLFixture, setHTMLFixture } from './__helpers__/fixtures'; -import { setupManualMocks } from './mocks/mocks_helper'; +import { initializeTestTimeout } from './__helpers__/timeout'; import customMatchers from './matchers'; +import { setupManualMocks } from './mocks/mocks_helper'; import './__helpers__/dom_shims'; import './__helpers__/jquery'; @@ -20,6 +20,10 @@ process.on('unhandledRejection', global.promiseRejectionHandler); setupManualMocks(); +// Fake the `Date` for the rest of the jest spec runtime environment. +// https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39496#note_503084332 +setGlobalDateToFakeDate(); + afterEach(() => // give Promises a bit more time so they fail the right test new Promise(setImmediate).then(() => { |