summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-05-16 00:42:03 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-05-16 00:42:03 +0000
commite3bddfc348a9b0faf41bd7c362ba2f1439fc6eb7 (patch)
treef203013b510ec3a5066598be8d25ca474d1f8c09
parent98b589f1f632e2311e0e2e693de628b1f972e652 (diff)
parent1eb3eca3137b33c1cf84779933480ea33a342fd6 (diff)
downloadgitlab-ce-e3bddfc348a9b0faf41bd7c362ba2f1439fc6eb7.tar.gz
Merge branch 'winh-fix-jest-fixtures-wrapper' into 'master'
Fix loadJSONFixtures wrapper in Jest See merge request gitlab-org/gitlab-ce!28328
-rw-r--r--spec/frontend/test_setup.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js
index c57e0e7cfc6..f0d62a3c41c 100644
--- a/spec/frontend/test_setup.js
+++ b/spec/frontend/test_setup.js
@@ -3,7 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers';
import Translate from '~/vue_shared/translate';
import axios from '~/lib/utils/axios_utils';
import { initializeTestTimeout } from './helpers/timeout';
-import { getJSONFixture, loadHTMLFixture, setHTMLFixture } from './helpers/fixtures';
+import { loadHTMLFixture, setHTMLFixture } from './helpers/fixtures';
process.on('unhandledRejection', global.promiseRejectionHandler);
@@ -46,9 +46,12 @@ Object.defineProperty(global.Element.prototype, 'innerText', {
// convenience wrapper for migration from Karma
Object.assign(global, {
loadFixtures: loadHTMLFixture,
- loadJSONFixtures: getJSONFixture,
- preloadFixtures() {},
setFixtures: setHTMLFixture,
+
+ // The following functions fill the fixtures cache in Karma.
+ // This is not necessary in Jest because we make no Ajax request.
+ loadJSONFixtures() {},
+ preloadFixtures() {},
});
// custom-jquery-matchers was written for an old Jest version, we need to make it compatible