[IMP] component: render does not return a promise anymore

This commit is contained in:
Géry Debongnie
2021-11-29 16:02:51 +01:00
committed by Aaron Bohy
parent 8a1ac13975
commit eceb3e6280
14 changed files with 103 additions and 208 deletions
+7 -6
View File
@@ -2,6 +2,7 @@ import {
App,
Component,
mount,
onError,
onMounted,
onPatched,
onWillPatch,
@@ -391,17 +392,17 @@ describe("Portal", () => {
</Portal>
</div>`;
state = { error: false };
setup() {
onError((e) => (error = e));
}
}
addOutsideDiv(fixture);
const parent = await mount(Parent, fixture);
parent.state.error = true;
let error: Error;
try {
await parent.render();
} catch (e) {
error = e as Error;
}
parent.state.error = true;
parent.render();
await nextTick();
expect(error!).toBeDefined();
const regexp =
/Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g;