From 8493789534c2e6b4cae9d2c2a54be3d4dc994b65 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 19 Jul 2024 12:24:47 +0200 Subject: [PATCH] fix first windows tests --- packages/playwright/src/runner/loadUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/playwright/src/runner/loadUtils.ts b/packages/playwright/src/runner/loadUtils.ts index 97587125c7..f4c3a3f55e 100644 --- a/packages/playwright/src/runner/loadUtils.ts +++ b/packages/playwright/src/runner/loadUtils.ts @@ -33,6 +33,8 @@ import { affectedTestFiles, dependenciesForTestFile } from '../transform/compila import { sourceMapSupport } from '../utilsBundle'; import type { RawSourceMap } from 'source-map'; +const toPosixPath = (s: string) => s.replaceAll(path.sep, path.posix.sep); + export async function collectProjectsAndTestFiles(testRun: TestRun, doNotRunTestsOutsideProjectFilter: boolean, additionalFileMatcher?: Matcher) { const config = testRun.config; const fsCache = new Map(); @@ -150,7 +152,7 @@ export async function detectChangedFiles(testRun: TestRun): Promise { const [gitRoot] = gitFileList('rev-parse --show-toplevel'); const trackedFilesWithChanges = gitFileList(`diff ${baseCommit} --name-only`).map(file => path.join(gitRoot, file)); - const filesWithChanges = [...untrackedFiles, ...trackedFilesWithChanges]; + const filesWithChanges = [...untrackedFiles, ...trackedFilesWithChanges].map(toPosixPath); for (const plugin of testRun.config.plugins) await plugin.instance?.populateDependencies?.();