diff --git a/src/mount_point.test.ts b/src/mount_point.test.ts index 7d69192..1971964 100644 --- a/src/mount_point.test.ts +++ b/src/mount_point.test.ts @@ -32,7 +32,7 @@ describe("Filesystem Metadata", () => { // < timeouts on windows are handled by the native bindings, and don't know about the magick "timeoutMs = 1" test option. it("should timeout mount points if timeoutMs = 1", async () => { await expect(getVolumeMountPoints({ timeoutMs: 1 })).rejects.toThrow( - /TimeoutError/, // < we can't check for instanceOf TimeoutError because it's imported from the tsup bundle + /timeout/i, // < we can't check for instanceOf TimeoutError because it's imported from the tsup bundle ); }); } diff --git a/src/volume_metadata.test.ts b/src/volume_metadata.test.ts index ac2375a..23f0e9e 100644 --- a/src/volume_metadata.test.ts +++ b/src/volume_metadata.test.ts @@ -20,6 +20,9 @@ import { MiB } from "./units.js"; const rootPath = systemDrive(); describe("Volume Metadata", () => { + beforeEach(() => { + jest.setTimeout(30_000); + }); it("should get root filesystem metadata", async () => { const metadata = await getVolumeMetadata(rootPath); @@ -56,8 +59,6 @@ describe("Volume Metadata errors", () => { }); describe("concurrent", () => { - jest.setTimeout(30_000); - it("should handle concurrent getVolumeMetadata() calls", async () => { const mountPoints = await getVolumeMountPoints(); const expectedMountPoint = systemDrive(); @@ -91,7 +92,7 @@ describe("concurrent", () => { } catch (error) { if (timeoutMs === 1) { console.log("Expected timeout", { mountPoint, timeoutMs, error }); - expect(String(error)).toMatch(/TimeoutError/); // < we can't check for instanceOf TimeoutError because it's imported from the tsup bundle + expect(String(error)).toMatch(/timeout/i); // < we can't check for instanceOf TimeoutError because it's imported from the tsup bundle return; } else if (!validMountPoints.includes(mountPoint)) { console.log("Expected bad mount point", {