From: Haoqun Jiang Date: Mon, 23 Aug 2021 08:25:13 +0000 (+0800) Subject: test: fix windows path compatibility X-Git-Tag: v3.0.0-beta.1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d72a85424d44b328b622e896fbded257468b3f8d;p=thirdparty%2Fvuejs%2Fcreate-vue.git test: fix windows path compatibility --- diff --git a/test.js b/test.js index fde3ec6c..785ad715 100644 --- a/test.js +++ b/test.js @@ -1,9 +1,11 @@ import fs from 'fs' import path from 'path' +import { fileURLToPath } from 'url' import { spawnSync } from 'child_process' -const playgroundDir = new URL('./playground/', import.meta.url).pathname +const __dirname = path.dirname(fileURLToPath(import.meta.url)) +const playgroundDir = path.resolve(__dirname, './playground/') for (const projectName of fs.readdirSync(playgroundDir)) { // TODO: test `dev` & `build` commands