diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2019-06-28 15:53:56 +0300 |
---|---|---|
committer | Lukas Eipert <leipert@gitlab.com> | 2019-06-28 19:47:00 +0300 |
commit | 85f65f5f7103ef27b50d102b4c2fe1d049d07b65 (patch) | |
tree | 090b24e2dc9f5ece57a8dee3aa9d3b59d6516a3e /spec | |
parent | 7d00eea6971dc128fdc8b43833304b54fa770bf2 (diff) |
Set logModifiedComponents in jest and karma
Also:
- stub MutationObserver in Jest
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/test_setup.js | 13 | ||||
-rw-r--r-- | spec/javascripts/test_bundle.js | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index c17d5253997..15cf18700ed 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -3,6 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers'; import $ from 'jquery'; import Translate from '~/vue_shared/translate'; import axios from '~/lib/utils/axios_utils'; +import { config as testUtilsConfig } from '@vue/test-utils'; import { initializeTestTimeout } from './helpers/timeout'; import { loadHTMLFixture, setHTMLFixture } from './helpers/fixtures'; @@ -60,9 +61,21 @@ Object.assign(global, { preloadFixtures() {}, }); +Object.assign(global, { + MutationObserver() { + return { + disconnect() {}, + observe() {}, + }; + }, +}); + // custom-jquery-matchers was written for an old Jest version, we need to make it compatible Object.entries(jqueryMatchers).forEach(([matcherName, matcherFactory]) => { expect.extend({ [matcherName]: matcherFactory().compare, }); }); + +// Tech debt issue TBD +testUtilsConfig.logModifiedComponents = false; diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 8c80a425581..2cc476ed52a 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -10,12 +10,16 @@ import VueResource from 'vue-resource'; import Translate from '~/vue_shared/translate'; import CheckEE from '~/vue_shared/mixins/is_ee'; import jasmineDiff from 'jasmine-diff'; +import { config as testUtilsConfig } from '@vue/test-utils'; import { getDefaultAdapter } from '~/lib/utils/axios_utils'; import { FIXTURES_PATH, TEST_HOST } from './test_constants'; import customMatchers from './matchers'; +// Tech debt issue TBD +testUtilsConfig.logModifiedComponents = false; + const isHeadlessChrome = /\bHeadlessChrome\//.test(navigator.userAgent); Vue.config.devtools = !isHeadlessChrome; Vue.config.productionTip = false; |