diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-03-28 20:42:32 +0100 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-03-29 07:33:30 +0100 |
commit | 346f7027e2285b3ff1280197045c4db541f4a700 (patch) | |
tree | 32af9343cb6f1f223f3d186bc5d78c52bd01c26d | |
parent | 7a7866a54a99bb97f97c9b85ce0a59f3078c5f1f (diff) | |
download | gitlab-ce-346f7027e2285b3ff1280197045c4db541f4a700.tar.gz |
Add workaround for innerText in Jest
-rw-r--r-- | spec/frontend/test_setup.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index 006fc60ef57..1edb2450b4c 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -23,3 +23,12 @@ beforeEach(done => { }); Vue.use(Translate); + +// workaround for JSDOM not supporting innerText +// see https://github.com/jsdom/jsdom/issues/1245 +Object.defineProperty(global.Element.prototype, 'innerText', { + get() { + return this.textContent; + }, + configurable: true, // make it so that it doesn't blow chunks on re-running tests with things like --watch +}); |