Gate desktop daemon dev providers in production

This commit is contained in:
Mohamed Boudra
2026-04-22 15:42:36 +07:00
parent aef54d5180
commit 02fc354686
2 changed files with 27 additions and 2 deletions
@@ -109,6 +109,7 @@ describe("node-entrypoint-launcher", () => {
env: {
PATH: "/usr/bin",
ELECTRON_RUN_AS_NODE: "1",
NODE_ENV: "production",
},
});
});
@@ -134,6 +135,25 @@ describe("node-entrypoint-launcher", () => {
});
});
it("forces packaged launches to production even when NODE_ENV is inherited as development", () => {
expect(
createNodeEntrypointInvocation({
execPath: "/Applications/Paseo.app/Contents/MacOS/Paseo",
isPackaged: true,
packagedRunnerPath:
"/Applications/Paseo.app/Contents/Resources/app.asar/dist/daemon/node-entrypoint-runner.js",
entrypoint: CLI_ENTRYPOINT,
argvMode: "node-script",
args: [],
baseEnv: { PATH: "/usr/bin", NODE_ENV: "development" },
}).env,
).toMatchObject({
PATH: "/usr/bin",
ELECTRON_RUN_AS_NODE: "1",
NODE_ENV: "production",
});
});
it("keeps node-style argv for packaged script entrypoints", () => {
expect(
createNodeEntrypointInvocation({
@@ -158,6 +178,7 @@ describe("node-entrypoint-launcher", () => {
env: {
PATH: "/usr/bin",
ELECTRON_RUN_AS_NODE: "1",
NODE_ENV: "production",
},
});
});