From d72a85424d44b328b622e896fbded257468b3f8d Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 23 Aug 2021 16:25:13 +0800 Subject: [PATCH] test: fix windows path compatibility --- test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.5