summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-05-09 13:45:37 +0200
committerWinnie Hellmann <winnie@gitlab.com>2019-05-09 14:50:25 +0200
commitb231329bb9f1402e5971f9134cdc27242cbb3ea7 (patch)
tree69e5dd106626b97cc520faa8e0b0beb2aa9df14d
parent9d4450263fd7dc53dafd62389871d8b1fcea5e1a (diff)
downloadgitlab-ce-winh-jestify-security-dashboard-filter-spec.tar.gz
Mock away document.createRange()winh-jestify-security-dashboard-filter-spec
(cherry picked from commit a0e7e2075c6182838a0645e0bbb3927e5f9a8bba)
-rw-r--r--spec/frontend/environment.js10
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() {