mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-20 00:17:44 +00:00
fix(test): settle vector imports before teardown
This commit is contained in:
@@ -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