diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2019-05-16 00:33:12 +0000 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-05-16 00:33:12 +0000 |
commit | 98b589f1f632e2311e0e2e693de628b1f972e652 (patch) | |
tree | 917188c7c8862eaf72369886876b2e7d5f864887 | |
parent | 5f25dab667454f9f250cbaa7785fa88bd12ff45e (diff) | |
parent | b231329bb9f1402e5971f9134cdc27242cbb3ea7 (diff) | |
download | gitlab-ce-98b589f1f632e2311e0e2e693de628b1f972e652.tar.gz |
Merge branch 'winh-jestify-security-dashboard-filter-spec' into 'master'
Mock away document.createRange() in Jest
See merge request gitlab-org/gitlab-ce!28222
-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() { |