Skip to content

Commit 849208e

Browse files
committed
Fix tests on Windows
1 parent 0e27d41 commit 849208e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/tailwindcss-language-server/src/project-locator.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ function testFixture(fixture: string, details: any[]) {
3030

3131
let detail = details[i]
3232

33-
let configPath = path.relative(fixturePath, project.config.path)
33+
let configPath = path.relative(normalizePath(fixturePath), project.config.path)
3434

3535
expect(configPath).toEqual(detail?.config)
3636

3737
if (detail?.content) {
38-
let expected = detail?.content.map((path) => path.replace('{URL}', fixturePath)).sort()
38+
let expected = detail?.content
39+
.map((path) => path.replace('{URL}', normalizePath(fixturePath)))
40+
.sort()
3941

4042
let actual = project.documentSelector
4143
.filter((selector) => selector.priority === 1 /** content */)
@@ -46,7 +48,9 @@ function testFixture(fixture: string, details: any[]) {
4648
}
4749

4850
if (detail?.selectors) {
49-
let expected = detail?.selectors.map((path) => path.replace('{URL}', fixturePath)).sort()
51+
let expected = detail?.selectors
52+
.map((path) => path.replace('{URL}', normalizePath(fixturePath)))
53+
.sort()
5054

5155
let actual = project.documentSelector.map((selector) => selector.pattern).sort()
5256

0 commit comments

Comments
 (0)