Skip to content

Commit f41bf1a

Browse files
committed
Need to flush promises in driver too
1 parent d02c45d commit f41bf1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Frontend/test/drivers/vitest/driver.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { flushPromises } from "@vue/test-utils";
12
import { test as testVitest, describe } from "vitest";
23
import { Driver } from "../../driver";
34
import { mount } from "@/mount";
@@ -61,6 +62,9 @@ const test = testVitest.extend<{ driver: Driver }>({
6162
//unmount the app after the test runs
6263
driver.disposeApp();
6364

65+
// We need to wait for any pending promises to resolve before resetting handlers and clearing storage
66+
await flushPromises();
67+
6468
console.log("Cleanup after test");
6569
mockServer.resetHandlers();
6670
//Make JSDOM create a fresh document per each test run

0 commit comments

Comments
 (0)