We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 858ce1e commit 0bc1a9fCopy full SHA for 0bc1a9f
tests/unit/helpers/deviceId.test.ts
@@ -17,6 +17,8 @@ describe("deviceId", () => {
17
});
18
19
afterEach(() => {
20
+ DeviceId.create(testLogger).close();
21
+
22
vi.restoreAllMocks();
23
24
@@ -76,13 +78,8 @@ describe("deviceId", () => {
76
78
// Abort the calculation
77
79
deviceId.close();
80
- // Should reject with AbortError - handle the unhandled rejection
- try {
81
- await promise;
82
- } catch (error) {
83
- expect(error).toBeInstanceOf(Error);
84
- expect((error as Error).name).toBe("AbortError");
85
- }
+ // Should reject with AbortError
+ await expect(promise).rejects.toThrow("Aborted");
86
87
88
it("should handle resolution errors gracefully", async () => {
0 commit comments