debian-mirror-gitlab/spec/frontend/helpers/dom_shims/inner_text.js
2020-01-01 13:55:28 +05:30

11 lines
369 B
JavaScript

// workaround for JSDOM not supporting innerText
// see https://github.com/jsdom/jsdom/issues/1245
Object.defineProperty(global.Element.prototype, 'innerText', {
get() {
return this.textContent;
},
set(value) {
this.textContext = value;
},
configurable: true, // make it so that it doesn't blow chunks on re-running tests with things like --watch
});