]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
test: fix windows path compatibility
authorHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 23 Aug 2021 08:25:13 +0000 (16:25 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 23 Aug 2021 08:25:13 +0000 (16:25 +0800)
test.js

diff --git a/test.js b/test.js
index fde3ec6c5c460cdcf58416c3a062053f1ecbf4ba..785ad715963d9d7b670f096a0564b92b0fda1ce5 100644 (file)
--- 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