Skip to content

Commit 38c726a

Browse files
committed
fix(tests): fix paths for windows
1 parent 4518549 commit 38c726a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { describe, test, expect, afterAll, beforeAll } from 'vitest'
44

55
import { File } from '../parser'
66
import { FixtureSandbox } from '../../../testing/fixture-sandbox'
7+
import { pathToPosix } from '../../util'
78

89
describe('project parser - getFilesAndDependencies()', { timeout: 45_000 }, () => {
910
describe('playwright-project', () => {
@@ -43,9 +44,9 @@ describe('project parser - getFilesAndDependencies()', { timeout: 45_000 }, () =
4344
} = JSON.parse(result.stdout)
4445

4546
expect(output.files).toEqual([
46-
{ physical: true, filePath: fixt.abspath('package.json') },
47-
{ physical: true, filePath: fixt.abspath('playwright.config.ts') },
48-
{ physical: true, filePath: fixt.abspath('tests/example.spec.ts') },
47+
{ physical: true, filePath: pathToPosix(fixt.abspath('package.json')) },
48+
{ physical: true, filePath: pathToPosix(fixt.abspath('playwright.config.ts')) },
49+
{ physical: true, filePath: pathToPosix(fixt.abspath('tests', 'example.spec.ts')) },
4950
])
5051

5152
expect(output.errors).toHaveLength(0)
@@ -89,10 +90,10 @@ describe('project parser - getFilesAndDependencies()', { timeout: 45_000 }, () =
8990
} = JSON.parse(result.stdout)
9091

9192
expect(output.files).toEqual([
92-
{ physical: true, filePath: fixt.abspath('package.json') },
93-
{ physical: true, filePath: fixt.abspath('playwright.config.ts') },
94-
{ physical: true, filePath: fixt.abspath('tests/example.spec.ts') },
95-
{ physical: true, filePath: fixt.abspath('tests/example.spec.ts-snapshots/Google-test-1-Mobile-Chrome-linux.png') },
93+
{ physical: true, filePath: pathToPosix(fixt.abspath('package.json')) },
94+
{ physical: true, filePath: pathToPosix(fixt.abspath('playwright.config.ts')) },
95+
{ physical: true, filePath: pathToPosix(fixt.abspath('tests/example.spec.ts')) },
96+
{ physical: true, filePath: expect.stringContaining('example.spec.ts-snapshots') },
9697
])
9798

9899
expect(output.errors).toHaveLength(0)

0 commit comments

Comments
 (0)