summaryrefslogtreecommitdiff
path: root/spec/frontend/test_setup.js
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2019-06-28 07:53:56 -0500
committerLukas Eipert <leipert@gitlab.com>2019-06-28 18:47:00 +0200
commit85f65f5f7103ef27b50d102b4c2fe1d049d07b65 (patch)
tree090b24e2dc9f5ece57a8dee3aa9d3b59d6516a3e /spec/frontend/test_setup.js
parent7d00eea6971dc128fdc8b43833304b54fa770bf2 (diff)
downloadgitlab-ce-85f65f5f7103ef27b50d102b4c2fe1d049d07b65.tar.gz
Set logModifiedComponents in jest and karma
Also: - stub MutationObserver in Jest
Diffstat (limited to 'spec/frontend/test_setup.js')
-rw-r--r--spec/frontend/test_setup.js13
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;