Commit e3bddfc3 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'winh-fix-jest-fixtures-wrapper' into 'master'

Fix loadJSONFixtures wrapper in Jest

See merge request gitlab-org/gitlab-ce!28328
parents 98b589f1 1eb3eca3
...@@ -3,7 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers'; ...@@ -3,7 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { initializeTestTimeout } from './helpers/timeout'; import { initializeTestTimeout } from './helpers/timeout';
import { getJSONFixture, loadHTMLFixture, setHTMLFixture } from './helpers/fixtures'; import { loadHTMLFixture, setHTMLFixture } from './helpers/fixtures';
process.on('unhandledRejection', global.promiseRejectionHandler); process.on('unhandledRejection', global.promiseRejectionHandler);
...@@ -46,9 +46,12 @@ Object.defineProperty(global.Element.prototype, 'innerText', { ...@@ -46,9 +46,12 @@ Object.defineProperty(global.Element.prototype, 'innerText', {
// convenience wrapper for migration from Karma // convenience wrapper for migration from Karma
Object.assign(global, { Object.assign(global, {
loadFixtures: loadHTMLFixture, loadFixtures: loadHTMLFixture,
loadJSONFixtures: getJSONFixture,
preloadFixtures() {},
setFixtures: setHTMLFixture, 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 // custom-jquery-matchers was written for an old Jest version, we need to make it compatible
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment