Skip to content

Commit e733dab

Browse files
committed
test: fix leading slash issue on Windows
1 parent 2aeef7e commit e733dab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

snapshot.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { spawnSync } from 'child_process'
2+
import path from 'path'
23

3-
const bin = new URL('./outfile.cjs', import.meta.url).pathname
4-
const playgroundDir = new URL('./playground/', import.meta.url).pathname
4+
const __dirname = path
5+
.dirname(new URL(import.meta.url).pathname)
6+
.substring(process.platform === 'win32' ? 1 : 0)
7+
8+
const bin = path.resolve(__dirname, './outfile.cjs')
9+
const playgroundDir = path.resolve(__dirname, './playground/')
510

611
function createProjectWithFeatureFlags(flags) {
712
const projectName = flags.join('-')

0 commit comments

Comments
 (0)