fix(test): settle vector imports before teardown
This commit is contained in:
1 parent
389faff8ee
commit
756d4aedc9
1 file changed
+9
@@ -10,6 +10,13 @@ const backend = vi.hoisted(() => ({
|
||||
vectorGetCollectionDetail: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("vue", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("vue")>();
|
||||
return {
|
||||
...actual,
|
||||
defineAsyncComponent: () => actual.defineComponent({ render: () => null }),
|
||||
};
|
||||
});
|
||||
vi.mock("vue-i18n", () => ({ useI18n: () => ({ t: (key: string) => key }) }));
|
||||
vi.mock("@/lib/backend/api", () => backend);
|
||||
vi.mock("@lucide/vue", async () => {
|
||||
@@ -86,9 +93,11 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await vi.dynamicImportSettled();
|
||||
await flushUi();
|
||||
app?.unmount();
|
||||
app = null;
|
||||
await vi.dynamicImportSettled();
|
||||
await flushUi();
|
||||
root?.remove();
|
||||
root = null;
|
||||
|
||||
Reference in new issue
Block a user