Skip to content

Commit e664d30

Browse files
committed
fix(tests): attempt to fix windows tests
1 parent 38c726a commit e664d30

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/cli/src/services/check-parser/__tests__/parse-files.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ describe('project parser - getFilesAndDependencies()', { timeout: 45_000 }, () =
4343
errors: string[]
4444
} = JSON.parse(result.stdout)
4545

46-
expect(output.files).toEqual([
46+
expect(output.files).toEqual(expect.arrayContaining([
4747
{ physical: true, filePath: pathToPosix(fixt.abspath('package.json')) },
4848
{ physical: true, filePath: pathToPosix(fixt.abspath('playwright.config.ts')) },
4949
{ physical: true, filePath: pathToPosix(fixt.abspath('tests', 'example.spec.ts')) },
50-
])
51-
50+
]))
51+
expect(output.files).toHaveLength(3)
5252
expect(output.errors).toHaveLength(0)
5353
})
5454
})
@@ -89,13 +89,13 @@ describe('project parser - getFilesAndDependencies()', { timeout: 45_000 }, () =
8989
errors: string[]
9090
} = JSON.parse(result.stdout)
9191

92-
expect(output.files).toEqual([
92+
expect(output.files).toEqual(expect.arrayContaining([
9393
{ physical: true, filePath: pathToPosix(fixt.abspath('package.json')) },
9494
{ physical: true, filePath: pathToPosix(fixt.abspath('playwright.config.ts')) },
9595
{ physical: true, filePath: pathToPosix(fixt.abspath('tests/example.spec.ts')) },
9696
{ physical: true, filePath: expect.stringContaining('example.spec.ts-snapshots') },
97-
])
98-
97+
]))
98+
expect(output.files).toHaveLength(4)
9999
expect(output.errors).toHaveLength(0)
100100
})
101101
})

packages/cli/src/services/check-parser/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export class Parser {
249249
?? await this.resolver.resolveDependenciesForFilePath(item.filePath, module.dependencies)
250250

251251
for (const dep of resolvedDependencies.missing) {
252-
missingFiles.add(pathToPosix(dep.filePath))
252+
missingFiles.add(dep.filePath)
253253
}
254254

255255
neighbors.markDepended(...resolvedDependencies.neighbors.depends)
@@ -264,7 +264,7 @@ export class Parser {
264264
const filePath = dep.sourceFile.meta.filePath
265265
files.add(filePath)
266266
}
267-
resultFileSet.add(pathToPosix(item.filePath))
267+
resultFileSet.add(item.filePath)
268268
}
269269

270270
if (missingFiles.size) {
@@ -275,7 +275,7 @@ export class Parser {
275275

276276
for (const filePath of resultFileSet) {
277277
outputFiles.push({
278-
filePath,
278+
filePath: pathToPosix(filePath),
279279
physical: true,
280280
})
281281
}

0 commit comments

Comments
 (0)