Open rreckonerr opened 4 years ago
Mentioned error appears because of some tests being started before the previous one is finished, which results in tests getting wrong originalContext and not being able to clean it up properly. Is my assumption correct? Any ideas how can I debug this further?
beforeEach(function () {
originalContext = _assign({}, this);
console.group(
`${originalContext.test.parent.title} => ${originalContext.currentTest.title}`
);
return setupContext(this, options)
.then(() => setupPauseTest(this))
.then(() => chainHooks(beforeEachHooks, this));
});
afterEach(function () {
return chainHooks(afterEachHooks, this)
.then(() => teardownContext(this))
.then(() => {
// delete any extraneous properties
for (let key in this) {
if (!(key in originalContext)) {
console.log("key to delete :>> ", key);
delete this[key];
}
}
// copy over the original values
_assign(this, originalContext);
})
.catch((error) => {
console.log("this :>> ", this);
console.log("originalContext :>> ", originalContext);
console.error(error);
})
.finally(() => {
console.groupEnd();
});
});
Example in the screenshot is failing randomly.
Can confirm this issue occurs
Cannot assign to read only property 'owner' of object '#<Context>'
I'm upgrading test suit from
ember-cli-mocha
toember-mocha
0.15.1 and get randomly failing tests all over again and those tests look fine when I'm running them separately. Is there a way to find out what's causing this error?