[IMP] app: improve API, small refactoring

This commit is contained in:
Géry Debongnie
2021-12-20 17:32:32 +01:00
committed by Mathieu Duckerts-Antoine
parent f4da50d350
commit 0b1c4dd4ef
13 changed files with 112 additions and 87 deletions
+3 -10
View File
@@ -1,5 +1,4 @@
import {
App,
Component,
mount,
onError,
@@ -432,10 +431,8 @@ describe("Portal", () => {
</div>`;
}
const env = {};
const app = new App(Parent);
app.configure({ env });
addOutsideDiv(fixture);
const parent = await mount(Parent, fixture);
const parent = await mount(Parent, fixture, { env });
expect(parent.env).toStrictEqual({});
});
@@ -529,10 +526,8 @@ describe("Portal: Props validation", () => {
</div>`;
}
let error: Error;
let app = new App(Parent);
app.configure({ dev: true });
try {
await app.mount(fixture);
await mount(Parent, fixture, { dev: true });
} catch (e) {
error = e as Error;
}
@@ -555,10 +550,8 @@ describe("Portal: Props validation", () => {
</div>`;
}
let error: Error;
let app = new App(Parent);
app.configure({ dev: true });
try {
await app.mount(fixture);
await mount(Parent, fixture, { dev: true });
} catch (e) {
error = e as Error;
}