Commit 98b589f1 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'winh-jestify-security-dashboard-filter-spec' into 'master'

Mock away document.createRange() in Jest

See merge request gitlab-org/gitlab-ce!28222
parents 5f25dab6 b231329b
...@@ -38,6 +38,16 @@ class CustomEnvironment extends JSDOMEnvironment { ...@@ -38,6 +38,16 @@ class CustomEnvironment extends JSDOMEnvironment {
this.global.fixturesBasePath = `${process.cwd()}/${ this.global.fixturesBasePath = `${process.cwd()}/${
IS_EE ? 'ee/' : '' IS_EE ? 'ee/' : ''
}spec/javascripts/fixtures`; }spec/javascripts/fixtures`;
// Not yet supported by JSDOM: https://github.com/jsdom/jsdom/issues/317
this.global.document.createRange = () => ({
setStart: () => {},
setEnd: () => {},
commonAncestorContainer: {
nodeName: 'BODY',
ownerDocument: this.global.document,
},
});
} }
async teardown() { async teardown() {
......
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