diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-04-01 18:55:57 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2019-04-01 18:55:57 +0000 |
commit | e3465a5dde695f316fec13dfde477660b402fdb8 (patch) | |
tree | b55cb313951476d1902764bfcee97266ed594a07 /spec | |
parent | 57cba4d1e9e9964359a5c55bca6558db0d511d98 (diff) | |
download | gitlab-ce-e3465a5dde695f316fec13dfde477660b402fdb8.tar.gz |
Add jQuery matchers to Jest
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/reports/components/report_section_spec.js (renamed from spec/javascripts/reports/components/report_section_spec.js) | 2 | ||||
-rw-r--r-- | spec/frontend/test_setup.js | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/javascripts/reports/components/report_section_spec.js b/spec/frontend/reports/components/report_section_spec.js index b02af8baaec..3b609484b9e 100644 --- a/spec/javascripts/reports/components/report_section_spec.js +++ b/spec/frontend/reports/components/report_section_spec.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import reportSection from '~/reports/components/report_section.vue'; -import mountComponent, { mountComponentWithSlots } from 'spec/helpers/vue_mount_component_helper'; +import mountComponent, { mountComponentWithSlots } from 'helpers/vue_mount_component_helper'; describe('Report section', () => { let vm; diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index 1e3c28e25eb..f09bcb5407e 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +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'; @@ -44,3 +45,10 @@ Object.assign(global, { preloadFixtures() {}, setFixtures: setHTMLFixture, }); + +// 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, + }); +}); |