Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

electron-launcher.test.mjs

28 lines1.0 KB

1import { assert, describe, it } from "vite-plus/test";
2​
3import { makeDevelopmentLauncherScript } from "./electron-launcher.mjs";
4​
5describe("electron development launcher", () => {
6 it("uses captured values only as fallbacks for a live runner environment", () => {
7 const script = makeDevelopmentLauncherScript({
8 electronBinaryPath: "/repo/node_modules/electron/Electron",
9 mainEntryPath: "/repo/apps/desktop/dist-electron/main.cjs",
10 desktopRoot: "/repo/apps/desktop",
11 environment: {
12 VITE_DEV_SERVER_URL: "http://127.0.0.1:8526",
13 T3CODE_PORT: "16566",
14 T3CODE_HOME: "/tmp/t3",
15 },
16 });
17​
18 assert.include(
19 script,
20 "if [ -z \"${VITE_DEV_SERVER_URL:-}\" ]; then export VITE_DEV_SERVER_URL='http://127.0.0.1:8526'; fi",
21 );
22 assert.notInclude(script, "\nexport VITE_DEV_SERVER_URL=");
23 assert.include(
24 script,
25 "exec '/repo/node_modules/electron/Electron' --t3code-dev-root='/repo/apps/desktop' '/repo/apps/desktop/dist-electron/main.cjs' \"$@\"",
26 );
27 });
28});