Skip to content

Commit

Permalink
how about now?
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-crabnebula committed Nov 23, 2023
1 parent 5fc1e43 commit a1c07c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bindings/packager/nodejs/__test__/index.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion bindings/packager/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 5 additions & 12 deletions bindings/updater/nodejs/__test__/index.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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");
Expand All @@ -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) => {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a1c07c9

Please sign in to comment.