Skip to content

Commit a95a074

Browse files
committed
update test for windows paths
1 parent 18f3b0c commit a95a074

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

e2e/native-esm/__tests__/native-esm.test.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,25 @@ test('should have correct import.meta', () => {
3737
expect(
3838
import.meta.url.endsWith('/e2e/native-esm/__tests__/native-esm.test.js'),
3939
).toBe(true);
40-
expect(
41-
import.meta.filename.endsWith(
42-
'/e2e/native-esm/__tests__/native-esm.test.js',
43-
),
44-
).toBe(true);
45-
expect(import.meta.filename.startsWith('/')).toBe(true);
46-
expect(import.meta.dirname.endsWith('/e2e/native-esm/__tests__')).toBe(true);
40+
if (process.platform === 'win32') {
41+
expect(
42+
import.meta.filename.endsWith(
43+
'\\e2e\\native-esm\\__tests__\\native-esm.test.js',
44+
),
45+
).toBe(true);
46+
expect(import.meta.dirname.endsWith('\\e2e\\native-esm\\__tests__')).toBe(
47+
true,
48+
);
49+
} else {
50+
expect(
51+
import.meta.filename.endsWith(
52+
'/e2e/native-esm/__tests__/native-esm.test.js',
53+
),
54+
).toBe(true);
55+
expect(import.meta.dirname.endsWith('/e2e/native-esm/__tests__')).toBe(
56+
true,
57+
);
58+
}
4759
});
4860

4961
test('should double stuff', () => {

0 commit comments

Comments
 (0)