From: Haoqun Jiang Date: Wed, 6 Oct 2021 14:30:30 +0000 (+0800) Subject: test: fix leading slash issue on Windows X-Git-Tag: v3.0.0-beta.4~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e733dab0fabf552ffbb3034fcebc58268ff80686;p=thirdparty%2Fvuejs%2Fcreate-vue.git test: fix leading slash issue on Windows --- diff --git a/snapshot.js b/snapshot.js index 58aa8722..06f3e39c 100644 --- a/snapshot.js +++ b/snapshot.js @@ -1,7 +1,12 @@ import { spawnSync } from 'child_process' +import path from 'path' -const bin = new URL('./outfile.cjs', import.meta.url).pathname -const playgroundDir = new URL('./playground/', import.meta.url).pathname +const __dirname = path + .dirname(new URL(import.meta.url).pathname) + .substring(process.platform === 'win32' ? 1 : 0) + +const bin = path.resolve(__dirname, './outfile.cjs') +const playgroundDir = path.resolve(__dirname, './playground/') function createProjectWithFeatureFlags(flags) { const projectName = flags.join('-')