Add workaround for innerText in Jest
This commit is contained in:
parent
7a7866a54a
commit
346f7027e2
|
@ -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
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue