test: tighten oauth lock path assertion

This commit is contained in:
Peter Steinberger
2026-05-09 13:25:39 +01:00
parent 2a00bd6209
commit 06eed5a454

View File

@@ -6,7 +6,13 @@ import { captureEnv } from "../../test-utils/env.js";
import { resolveOAuthRefreshLockPath } from "./paths.js";
async function expectPathMissing(targetPath: string): Promise<void> {
await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" });
try {
await fs.stat(targetPath);
} catch (error) {
expect((error as NodeJS.ErrnoException).code).toBe("ENOENT");
return;
}
throw new Error(`Expected missing path: ${targetPath}`);
}
describe("resolveOAuthRefreshLockPath", () => {