From d4c50fceeb28af82e9d8c618146a6267cf2adc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20Wang=28=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7=29?= <308487730@qq.com> Date: Mon, 28 Oct 2024 19:55:29 +0800 Subject: [PATCH] test: compatible windows platform --- __tests__/e2e.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/__tests__/e2e.spec.ts b/__tests__/e2e.spec.ts index ae38057..7346f66 100644 --- a/__tests__/e2e.spec.ts +++ b/__tests__/e2e.spec.ts @@ -19,6 +19,7 @@ import { const CLI_PATH = path.join(__dirname, '..') const projectName = 'electron-vite-test' const generatePath = path.join(CLI_PATH, projectName) +const pkgManager = process.platform === 'win32' ? 'npm.cmd' : 'npm' let electronApp: ElectronApplication let page: Page @@ -29,7 +30,7 @@ beforeAll(async () => { // enableElectronMirror() - const installLogs = execSync('npm install') + const installLogs = execSync(`${pkgManager} install`) writeFileSync('npm-install.log', installLogs) const buildLogs = execSync('vite build')