From 7928854f44918f648a00bf274304c58061d378ee Mon Sep 17 00:00:00 2001 From: Netlify Bot Date: Fri, 24 Apr 2026 14:35:13 +0100 Subject: [PATCH] chore: fix Windows test --- tests/unit/commands/database/db-status.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/commands/database/db-status.test.ts b/tests/unit/commands/database/db-status.test.ts index d241f5ead3b..8dc31ae79d3 100644 --- a/tests/unit/commands/database/db-status.test.ts +++ b/tests/unit/commands/database/db-status.test.ts @@ -46,8 +46,10 @@ vi.mock('fs/promises', async (importOriginal) => { readdir: (...args: unknown[]) => mockReaddir(...args), readFile: (path: unknown, ...rest: unknown[]) => { // Only intercept reads under the mocked project root — the CLI's own - // package.json and other ambient reads go straight through. - if (typeof path === 'string' && path.startsWith('/project/')) { + // package.json and other ambient reads go straight through. Normalize + // backslashes so this works on Windows too (path.join on Windows turns + // `/project` + `package.json` into `\project\package.json`). + if (typeof path === 'string' && path.replace(/\\/g, '/').startsWith('/project/')) { // eslint-disable-next-line @typescript-eslint/no-unsafe-return return mockReadFile(path, ...rest) }