From a1c07c971b8bc01977e3ae7a06b3bbb278fc94d1 Mon Sep 17 00:00:00 2001 From: amr-crabnebula Date: Thu, 23 Nov 2023 18:50:31 +0200 Subject: [PATCH] how about now? --- .../packager/nodejs/__test__/index.spec.mjs | 2 +- bindings/packager/nodejs/package.json | 1 - bindings/updater/nodejs/__test__/index.spec.mjs | 17 +++++------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/bindings/packager/nodejs/__test__/index.spec.mjs b/bindings/packager/nodejs/__test__/index.spec.mjs index 12f03778..3df6dca2 100644 --- a/bindings/packager/nodejs/__test__/index.spec.mjs +++ b/bindings/packager/nodejs/__test__/index.spec.mjs @@ -7,7 +7,7 @@ import { bundleApp } from '../build/index.js' test('log error', async (t) => { process.env.CI = true process.chdir('../../../examples/electron') - execSync('yarn install') + execSync('pnpm install') t.is(await bundleApp({ formats: process.env.PACKAGER_FORMATS ? process.env.PACKAGER_FORMATS.split(',') : null }, { verbosity: 2 }), undefined) diff --git a/bindings/packager/nodejs/package.json b/bindings/packager/nodejs/package.json index e8cf19a5..b306dae4 100644 --- a/bindings/packager/nodejs/package.json +++ b/bindings/packager/nodejs/package.json @@ -32,7 +32,6 @@ "build": "pnpm build:config && pnpm build:ts && napi build --platform --profile release-size-optimized", "build:debug": "pnpm build:config && pnpm build:ts && napi build --platform", "prepublishOnly": "napi prepublish -t npm --gh-release-id $RELEASE_ID", - "pretest": "npm run build:ts", "test": "ava --no-worker-threads", "universal": "napi universal", "version": "napi version" diff --git a/bindings/updater/nodejs/__test__/index.spec.mjs b/bindings/updater/nodejs/__test__/index.spec.mjs index 53b52fa0..2fc6a449 100644 --- a/bindings/updater/nodejs/__test__/index.spec.mjs +++ b/bindings/updater/nodejs/__test__/index.spec.mjs @@ -19,17 +19,10 @@ test("it works", async (t) => { process.arch === "x64" ? "x86_64" : "i686" }`; - // build packager - await execa("pnpm", ["build"], { - cwd: join(__dirname, "..", "..", "..", "packager", "nodejs"), - stdio: "inherit", - }); - const buildApp = async (version, updaterFormats) => { - await execa("pnpm", ["install"], { cwd: appDir, stdio: "inherit" }); await writeFile( join(appDir, "dist", "ver.js"), - `module.exports.version = "${version}";` + `module.exports.version = "${version}";`, ); try { @@ -50,7 +43,7 @@ test("it works", async (t) => { CARGO_PACKAGER_SIGN_PRIVATE_KEY: UPDATER_PRIVATE_KEY, CARGO_PACKAGER_SIGN_PRIVATE_KEY_PASSWORD: "", }, - } + }, ); } catch (e) { console.error("failed to package app"); @@ -61,7 +54,7 @@ test("it works", async (t) => { // bundle app update await buildApp( "1.0.0", - isWindows ? ["nsis", "wix"] : isMacos ? ["app"] : ["appimage"] + isWindows ? ["nsis", "wix"] : isMacos ? ["app"] : ["appimage"], ); const packgePaths = (version) => { @@ -150,7 +143,7 @@ test("it works", async (t) => { ? "updater-app-test.exe" : isMacos ? "PackagerAppUpdaterTestNodejs.app/Contents/MacOS/cargo-packager-updater-app-test" - : `updater-app-test_${version}_x86_64.AppImage` + : `updater-app-test_${version}_x86_64.AppImage`, ); try { @@ -190,7 +183,7 @@ test("it works", async (t) => { counter += 1; if (counter == 10) { console.error( - "updater test timedout and couldn't verify the update has happened" + "updater test timedout and couldn't verify the update has happened", ); break; }