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/frontend | |
parent | 7d00eea6971dc128fdc8b43833304b54fa770bf2 (diff) |
Set logModifiedComponents in jest and karma
Also:
- stub MutationObserver in Jest
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/test_setup.js | 13 |
1 files changed, 13 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; |