Skip to content

Commit

Permalink
fix nodejs integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-crabnebula committed Nov 23, 2023
1 parent 6302a74 commit fbbb352
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bindings/updater/nodejs/__test__/index.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@ test("it works", async (t) => {
// bundle initial app version
await buildApp("0.1.0", [updaterFormat]);

if (isWindows) {
// install the app through the installer
const isNsis = updaterFormat === "nsis";
const installDir = join(appDir, "dist");
const installerArg = `"${outPackagePath}"`;
await execa("powershell.exe", [
"-NoProfile",
"-WindowStyle",
"Hidden",
"Start-Process",
installerArg,
"-ArgumentList",
`${isNsis ? "/P" : "/passive"}, ${
isNsis ? "/D" : "INSTALLDIR"
}=${installDir}`,
]);
}

// wait 2secs to make sure the installer have released its lock on the binary
await sleep(2000);

const app = join(
appDir,
"dist",
Expand Down Expand Up @@ -155,6 +176,7 @@ test("it works", async (t) => {
const version = stdout.split("\n")[0];
t.is(version, "1.0.0");
if (version == "1.0.0") {
console.log(`app is updated, new version: ${version}`);
break;
}

Expand Down

0 comments on commit fbbb352

Please sign in to comment.