diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/frontend/test_setup.js | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/frontend/test_setup.js')
-rw-r--r-- | spec/frontend/test_setup.js | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index 2a3eddf7b4e..a122b06fdda 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -4,15 +4,18 @@ import 'jquery'; import * as jqueryMatchers from 'custom-jquery-matchers'; import { config as testUtilsConfig } from '@vue/test-utils'; import Translate from '~/vue_shared/translate'; -import { initializeTestTimeout } from './helpers/timeout'; -import { getJSONFixture, loadHTMLFixture, setHTMLFixture } from './helpers/fixtures'; +import { initializeTestTimeout } from './__helpers__/timeout'; +import { getJSONFixture, loadHTMLFixture, setHTMLFixture } from './__helpers__/fixtures'; import { setupManualMocks } from './mocks/mocks_helper'; import customMatchers from './matchers'; -import './helpers/dom_shims'; -import './helpers/jquery'; +import './__helpers__/dom_shims'; +import './__helpers__/jquery'; import '~/commons/bootstrap'; +// This module has some fairly decent visual test coverage in it's own repository. +jest.mock('@gitlab/favicon-overlay'); + process.on('unhandledRejection', global.promiseRejectionHandler); setupManualMocks(); @@ -25,7 +28,7 @@ afterEach(() => }), ); -initializeTestTimeout(process.env.CI ? 6000 : 5000); +initializeTestTimeout(process.env.CI ? 6000 : 500); Vue.config.devtools = false; Vue.config.productionTip = false; @@ -58,8 +61,18 @@ Object.entries(jqueryMatchers).forEach(([matcherName, matcherFactory]) => { expect.extend(customMatchers); -// Tech debt issue TBD -testUtilsConfig.logModifiedComponents = false; +testUtilsConfig.deprecationWarningHandler = (method, message) => { + const ALLOWED_DEPRECATED_METHODS = [ + // https://gitlab.com/gitlab-org/gitlab/-/issues/295679 + 'finding components with `find` or `get`', + + // https://gitlab.com/gitlab-org/gitlab/-/issues/295680 + 'finding components with `findAll`', + ]; + if (!ALLOWED_DEPRECATED_METHODS.includes(method)) { + global.console.error(message); + } +}; Object.assign(global, { requestIdleCallback(cb) { |