diff options
Diffstat (limited to 'spec/frontend/environment.js')
-rw-r--r-- | spec/frontend/environment.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/frontend/environment.js b/spec/frontend/environment.js index 9612162ad0c..a8c8688441d 100644 --- a/spec/frontend/environment.js +++ b/spec/frontend/environment.js @@ -38,6 +38,16 @@ class CustomEnvironment extends JSDOMEnvironment { this.global.fixturesBasePath = `${process.cwd()}/${ IS_EE ? 'ee/' : '' }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() { |