Skip to content

Commit 0bc1a9f

Browse files
committed
update test
1 parent 858ce1e commit 0bc1a9f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/unit/helpers/deviceId.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe("deviceId", () => {
1717
});
1818

1919
afterEach(() => {
20+
DeviceId.create(testLogger).close();
21+
2022
vi.restoreAllMocks();
2123
});
2224

@@ -76,13 +78,8 @@ describe("deviceId", () => {
7678
// Abort the calculation
7779
deviceId.close();
7880

79-
// Should reject with AbortError - handle the unhandled rejection
80-
try {
81-
await promise;
82-
} catch (error) {
83-
expect(error).toBeInstanceOf(Error);
84-
expect((error as Error).name).toBe("AbortError");
85-
}
81+
// Should reject with AbortError
82+
await expect(promise).rejects.toThrow("Aborted");
8683
});
8784

8885
it("should handle resolution errors gracefully", async () => {

0 commit comments

Comments
 (0)