From c96f4a6b128df7e0e3d2560203449362d53bcb2f Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sun, 30 Jun 2024 18:12:03 +0200 Subject: [PATCH] Fix tests --- package.json | 2 +- test/e2e/recipe/index.ts | 2 ++ test/unit/getPath-test-app/package.json | 1 - test/unit/getPath-test-app/yarn.lock | 0 test/unit/getPath.test.ts | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 test/unit/getPath-test-app/yarn.lock diff --git a/package.json b/package.json index 9181a992..b6154fcb 100644 --- a/package.json +++ b/package.json @@ -83,5 +83,5 @@ "volta": { "node": "20.13.1" }, - "packageManager": "yarn@4.2.2" + "packageManager": "yarn@4.3.1" } diff --git a/test/e2e/recipe/index.ts b/test/e2e/recipe/index.ts index 38cf4804..97a1e05c 100644 --- a/test/e2e/recipe/index.ts +++ b/test/e2e/recipe/index.ts @@ -199,6 +199,8 @@ export class RecipeRunner { shell: true, cwd: appPath, stdio: process.env.DEBUG ? 'inherit' : 'pipe', + // Yarn v4 fail to install in CI without lock files + env: { ...process.env, YARN_ENABLE_IMMUTABLE_INSTALLS: 'false' }, }); if (result.status) { diff --git a/test/unit/getPath-test-app/package.json b/test/unit/getPath-test-app/package.json index a3e1e5fc..1bc82b78 100644 --- a/test/unit/getPath-test-app/package.json +++ b/test/unit/getPath-test-app/package.json @@ -3,7 +3,6 @@ "version": "1.0.0", "main": "main.js", "scripts": { - "start": "../../../node_modules/.bin/electron ." } } diff --git a/test/unit/getPath-test-app/yarn.lock b/test/unit/getPath-test-app/yarn.lock deleted file mode 100644 index e69de29b..00000000 diff --git a/test/unit/getPath.test.ts b/test/unit/getPath.test.ts index f72f1177..e90db47b 100644 --- a/test/unit/getPath.test.ts +++ b/test/unit/getPath.test.ts @@ -4,7 +4,7 @@ import { describe, expect, test } from 'vitest'; describe('app.getPath', () => { test('not called before init', () => { - const result = spawnSync('yarn', ['start'], { cwd: join(__dirname, 'getPath-test-app') }); + const result = spawnSync('npm', ['start'], { cwd: join(__dirname, 'getPath-test-app') }); // status is null on Windows in CI for some unknown reason if (process.platform !== 'win32') { expect(result.status).to.equal(0);