summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-05-15 14:18:54 +0200
committerWinnie Hellmann <winnie@gitlab.com>2019-05-15 15:31:52 +0200
commit1eb3eca3137b33c1cf84779933480ea33a342fd6 (patch)
tree0247a016a9c24abeb3d1ad4810cb547acab8282c
parent0c63ad850af1fe19eeae5778f984030d28617dda (diff)
downloadgitlab-ce-winh-fix-jest-fixtures-wrapper.tar.gz
Fix loadJSONFixtures wrapper in Jestwinh-fix-jest-fixtures-wrapper
-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