| 4 | import { spawn, spawnSync } from "node:child_process"; |
| 5 | import { once } from "node:events"; |
| 6 | import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from "node:fs"; |
| 7 | import { join, resolve as resolvePath } from "node:path"; |
| 8 | import { tmpdir } from "node:os"; |
| 9 | const fixtureDir = mkdtempSync(join(tmpdir(), "node-url-import-cli-test-")); |
| 10 |
| 11 | // Prints the flag-relevant environment the CLI translates its own flags into, |
| 12 | // plus the script args it received. Lets us assert arg-splitting and |
| 13 | // flag → env translation from a single local fixture (no network). |
| 14 | const DUMP_SCRIPT = `console.log(JSON.stringify({ |
| 15 | argv: process.argv.slice(2), |
| 16 | execArgv: process.execArgv, |
| 17 | env: { |
| 18 | RELOAD: process.env.URL_IMPORT_RELOAD, |
| 19 | TMP: process.env.URL_IMPORT_TMP, |
| 20 | LOCK: process.env.URL_IMPORT_LOCK, |
| 21 | FROZEN: process.env.URL_IMPORT_FROZEN, |
| 22 | MAIN: process.env.URL_IMPORT_MAIN, |
| 23 | CDN: process.env.URL_IMPORT_CDN, |
| 24 | }, |
| 25 | })); |
| 26 | `; |
| 27 |
| 28 | const dumpScript = join(fixtureDir, "dump.mjs"); |
| 29 |
| 30 | interface Dump { |
| 31 | argv: string[]; |
| 32 | execArgv: string[]; |
| 33 | env: { |
| 34 | RELOAD?: string; |
| 35 | TMP?: string; |
| 36 | LOCK?: string; |
| 37 | FROZEN?: string; |
| 38 | MAIN?: string; |
| 39 | CDN?: string; |
| 40 | }; |
| 41 | } |
| 42 |
| 43 | function runCli(args: string[], extraEnv: Record<string, string> = {}, input = "") { |
| 44 | return spawnSync(process.execPath, ["src/cli.ts", ...args], { |
| 45 | cwd: process.cwd(), |
| 46 | env: { ...process.env, DENO_DIR: join(fixtureDir, "deno"), TMPDIR: fixtureDir, ...extraEnv }, |
| 47 | encoding: "utf-8", |
| 48 | input, |
| 49 | timeout: 30_000, |
| 50 | }); |
| 51 | } |
| 52 |
| 53 | // Run the CLI against the dump fixture and parse its JSON output. |
| 54 | function runDump(args: string[]): Dump { |
| 55 | const result = runCli([...args, dumpScript]); |
| 56 | assert.equal( |
| 57 | result.status, |
| 58 | 0, |
| 59 | `CLI exited with ${result.status}\nstderr: ${result.stderr}`, |
| 60 | ); |
| 61 | return JSON.parse(result.stdout.trim()); |
| 62 | } |
| 63 |
| 64 | before(() => { |
| 65 | mkdirSync(fixtureDir, { recursive: true }); |
| 66 | writeFileSync(dumpScript, DUMP_SCRIPT, "utf-8"); |
| 67 | }); |
| 68 |
| 69 | after(() => { |
| 70 | rmSync(fixtureDir, { recursive: true, force: true }); |
| 71 | }); |
| 72 |
| 73 | describe("CLI: help and usage", () => { |
| 74 | it("lets Node read stdin when no arguments are given", () => { |
| 75 | const result = runCli([], {}, "console.log(73)"); |
| 76 | assert.equal(result.status, 0, result.stderr); |
| 77 | assert.equal(result.stdout.trim(), "73"); |
| 78 | }); |
| 79 |
| 80 | it("should print usage and exit 0 with --help", () => { |
| 81 | const result = runCli(["--help"]); |
| 82 | assert.equal(result.status, 0); |
| 83 | assert.ok(result.stdout.length > 0); |
| 84 | }); |
| 85 | }); |
| 86 |
| 87 | it("prints an expression with -p and the native -pe shorthand", () => { |
| 88 | for (const flag of ["-p", "-pe"]) { |
| 89 | const result = runCli([flag, "21 * 2"]); |
| 90 | assert.equal(result.status, 0, result.stderr); |
| 91 | assert.equal(result.stdout.trim(), "42"); |
| 92 | } |
| 93 | }); |
| 94 |
| 95 | it("preserves eval arguments after -- without consuming own-looking flags", () => { |
| 96 | const result = runCli(["--tmp", "--input-type=module", "--eval", DUMP_SCRIPT, "--", "argument", "--reload"]); |
| 97 | assert.equal(result.status, 0, result.stderr); |
| 98 | const output: Dump = JSON.parse(result.stdout); |
| 99 | assert.deepEqual(output.argv, ["--reload"]); |
| 100 | assert.equal(output.env.TMP, "1"); |
| 101 | assert.equal(output.env.RELOAD, undefined); |
| 102 | assert.deepEqual(output.execArgv.slice(2), ["--input-type=module", "--eval", DUMP_SCRIPT]); |
| 103 | }); |
| 104 |
| 105 | it("reads an explicit stdin entry with its script arguments", () => { |
| 106 | const result = runCli(["--tmp", "-", "--reload", "--clear-cache"], {}, DUMP_SCRIPT); |
| 107 | assert.equal(result.status, 0, result.stderr); |
| 108 | const output: Dump = JSON.parse(result.stdout); |
| 109 | assert.deepEqual(output.argv, ["--reload", "--clear-cache"]); |
| 110 | assert.equal(output.env.TMP, "1"); |
| 111 | assert.equal(output.env.RELOAD, undefined); |
| 112 | }); |
| 113 |
| 114 | it("forwards --version to Node", () => { |
| 115 | const result = runCli(["--version"]); |
| 116 | assert.equal(result.status, 0, result.stderr); |
| 117 | assert.equal(result.stdout.trim(), process.version); |
| 118 | }); |
| 119 |
| 120 | it("leaves invalid Node flags and missing Node values for Node to reject", () => { |
| 121 | for (const args of [["--not-a-node-option"], ["--title"], ["--eval"], ["--title", "--tmp"]]) { |
| 122 | const expected = spawnSync(process.execPath, args, { encoding: "utf8", input: "" }); |
| 123 | const result = runCli(args); |
| 124 | assert.equal(result.status, expected.status); |
| 125 | assert.notEqual(result.status, 0); |
| 126 | assert.equal(result.stdout, expected.stdout); |
| 127 | } |
| 128 | }); |
| 129 |
| 130 | describe("CLI: --clear-cache", () => { |
| 131 | it("should clear the cache and exit 0", () => { |
| 132 | mkdirSync(join(fixtureDir, "deno", "remote"), { recursive: true }); |
| 133 | writeFileSync(join(fixtureDir, "deno", "remote", "sentinel"), "fixture"); |
| 134 | const result = runCli(["--clear-cache"]); |
| 135 | assert.equal(result.status, 0); |
| 136 | assert.equal(existsSync(join(fixtureDir, "deno", "remote")), false); |
| 137 | }); |
| 138 | }); |
| 139 |
| 140 | describe("CLI: script argument forwarding", () => { |
| 141 | // Script args go *after* the target, so these bypass runDump (which appends |
| 142 | // the fixture path at the end) and invoke the CLI directly. |
| 143 | function argvAfter(scriptArgs: string[]): string[] { |
| 144 | const result = runCli([dumpScript, ...scriptArgs]); |
| 145 | assert.equal(result.status, 0, result.stderr); |
| 146 | return (JSON.parse(result.stdout.trim()) as Dump).argv; |
| 147 | } |
| 148 |
| 149 | it("should not leak a stray '--' into process.argv when no script args are given", () => { |
| 150 | assert.deepEqual(argvAfter([]), []); |
| 151 | }); |
| 152 |
| 153 | it("should forward plain script args after the script", () => { |
| 154 | assert.deepEqual(argvAfter(["foo", "bar"]), ["foo", "bar"]); |
| 155 | }); |
| 156 |
| 157 | it("forwards every own option after the script without changing loader configuration", () => { |
| 158 | const scriptArgs = ["--reload", "--tmp", "--lock", "--frozen", "--cdn=https://example.test/", "--lock-file"]; |
| 159 | const result = runCli([dumpScript, ...scriptArgs]); |
| 160 | assert.equal(result.status, 0, result.stderr); |
| 161 | const output: Dump = JSON.parse(result.stdout); |
| 162 | assert.deepEqual(output.argv, scriptArgs); |
| 163 | assert.deepEqual(output.env, {}); |
| 164 | }); |
| 165 |
| 166 | it("does not clear the cache for a script's --clear-cache argument", () => { |
| 167 | const remoteDirectory = join(fixtureDir, "deno", "remote"); |
| 168 | mkdirSync(remoteDirectory, { recursive: true }); |
| 169 | const sentinel = join(remoteDirectory, "preserved"); |
| 170 | writeFileSync(sentinel, "fixture"); |
| 171 | const result = runCli([dumpScript, "--clear-cache"]); |
| 172 | assert.equal(result.status, 0, result.stderr); |
| 173 | assert.deepEqual(JSON.parse(result.stdout).argv, ["--clear-cache"]); |
| 174 | assert.equal(existsSync(sentinel), true); |
| 175 | }); |
| 176 |
| 177 | it("supports -- before flag-like script names without leaking the separator", () => { |
| 178 | const scriptPath = join(process.cwd(), "-cli-flag-fixture.mjs"); |
| 179 | writeFileSync(scriptPath, DUMP_SCRIPT); |
| 180 | try { |
| 181 | const result = runCli(["--", "-cli-flag-fixture.mjs", "argument"]); |
| 182 | assert.equal(result.status, 0, result.stderr); |
| 183 | assert.deepEqual(JSON.parse(result.stdout).argv, ["argument"]); |
| 184 | } finally { |
| 185 | rmSync(scriptPath, { force: true }); |
| 186 | } |
| 187 | }); |
| 188 |
| 189 | it("should forward flag-like args placed after the script", () => { |
| 190 | // Args after the script positional are script args, even if flag-like. |
| 191 | assert.deepEqual(argvAfter(["-h", "--verbose"]), ["-h", "--verbose"]); |
| 192 | }); |
| 193 | }); |
| 194 |
| 195 | describe("CLI: own-flag to env translation", () => { |
| 196 | it("should not set any URL_IMPORT_* vars when no own flags are passed", () => { |
| 197 | const { env } = runDump([]); |
| 198 | assert.equal(env.RELOAD, undefined); |
| 199 | assert.equal(env.TMP, undefined); |
| 200 | assert.equal(env.LOCK, undefined); |
| 201 | assert.equal(env.FROZEN, undefined); |
| 202 | }); |
| 203 |
| 204 | it("should translate --reload to URL_IMPORT_RELOAD=1", () => { |
| 205 | assert.equal(runDump(["--reload"]).env.RELOAD, "1"); |
| 206 | }); |
| 207 |
| 208 | it("should translate --tmp to URL_IMPORT_TMP=1", () => { |
| 209 | assert.equal(runDump(["--tmp"]).env.TMP, "1"); |
| 210 | }); |
| 211 |
| 212 | it("should translate --lock to URL_IMPORT_LOCK=<cwd>/deno.lock", () => { |
| 213 | assert.equal(runDump(["--lock"]).env.LOCK, resolvePath("deno.lock")); |
| 214 | }); |
| 215 |
| 216 | it("should translate --lock-file <path> to an absolute URL_IMPORT_LOCK", () => { |
| 217 | const { env } = runDump(["--lock-file", "custom.lock"]); |
| 218 | assert.equal(env.LOCK, resolvePath("custom.lock")); |
| 219 | }); |
| 220 |
| 221 | it("should translate --frozen to URL_IMPORT_FROZEN=1 and imply a lock file", () => { |
| 222 | const { env } = runDump(["--frozen"]); |
| 223 | assert.equal(env.FROZEN, "1"); |
| 224 | assert.equal(env.LOCK, resolvePath("deno.lock")); |
| 225 | }); |
| 226 |
| 227 | it("rejects unsupported negative and boolean-valued options", () => { |
| 228 | for (const option of ["--no-cdn", "--cdn=false", "--no-frozen", "--frozen=false", "--reload=true", "--tmp=false"]) { |
| 229 | assert.notEqual(runCli([option, dumpScript]).status, 0); |
| 230 | } |
| 231 | }); |
| 232 |
| 233 | it("preserves inherited settings without enabling a lock for frozen alone", () => { |
| 234 | const result = runCli([dumpScript], { URL_IMPORT_FROZEN: "1", URL_IMPORT_CDN: "https://example.test/", URL_IMPORT_LOCK: "" }); |
| 235 | assert.equal(result.status, 0, result.stderr); |
| 236 | const output: Dump = JSON.parse(result.stdout); |
| 237 | assert.equal(output.env.FROZEN, "1"); |
| 238 | assert.equal(output.env.CDN, "https://example.test/"); |
| 239 | assert.equal(output.env.LOCK, ""); |
| 240 | }); |
| 241 |
| 242 | it("rejects missing option values before the script", () => { |
| 243 | assert.notEqual(runCli(["--lock-file"]).status, 0); |
| 244 | }); |
| 245 |
| 246 | it("lets the last CDN option determine the selected base", () => { |
| 247 | assert.equal(runDump(["--cdn=https://example.test/", "--cdn"]).env.CDN, "https://esm.sh/"); |
| 248 | assert.equal(runDump(["--cdn", "--cdn=https://example.test/"]).env.CDN, "https://example.test/"); |
| 249 | }); |
| 250 |
| 251 | it("rejects non-HTTP and ambiguous CDN bases", () => { |
| 252 | assert.notEqual(runCli(["--cdn=file:///tmp/", dumpScript]).status, 0); |
| 253 | assert.notEqual(runCli(["--cdn=https://example.test/?query=1", dumpScript]).status, 0); |
| 254 | }); |
| 255 |
| 256 | it("should combine multiple own flags", () => { |
| 257 | const { env } = runDump(["--reload", "--tmp"]); |
| 258 | assert.equal(env.RELOAD, "1"); |
| 259 | assert.equal(env.TMP, "1"); |
| 260 | }); |
| 261 |
| 262 | it("should not set URL_IMPORT_CDN without --cdn", () => { |
| 263 | assert.equal(runDump([]).env.CDN, undefined); |
| 264 | }); |
| 265 |
| 266 | it("should translate bare --cdn to the default CDN base", () => { |
| 267 | assert.equal(runDump(["--cdn"]).env.CDN, "https://esm.sh/"); |
| 268 | }); |
| 269 |
| 270 | it("should translate --cdn=<url> to that base, adding a trailing slash", () => { |
| 271 | assert.equal(runDump(["--cdn=https://cdn.example.com"]).env.CDN, "https://cdn.example.com/"); |
| 272 | assert.equal(runDump(["--cdn=https://esm.sh/"]).env.CDN, "https://esm.sh/"); |
| 273 | }); |
| 274 |
| 275 | it("should not swallow the target when --cdn has no value", () => { |
| 276 | // A bare --cdn must not consume the following positional as its value. |
| 277 | const dump = runDump(["--cdn"]); |
| 278 | assert.equal(dump.env.CDN, "https://esm.sh/"); |
| 279 | assert.deepEqual(dump.argv, []); |
| 280 | }); |
| 281 | }); |
| 282 |
| 283 | describe("CLI: node flag pass-through", () => { |
| 284 | it("should forward unknown flags before the script to node without leaking into argv", () => { |
| 285 | // --title is a harmless node flag; it must reach node's execArgv and must |
| 286 | // not leak into the script's process.argv. |
| 287 | const dump = runDump(["--title=node-url-import-test"]); |
| 288 | assert.deepEqual(dump.argv, []); |
| 289 | assert.ok( |
| 290 | dump.execArgv.includes("--title=node-url-import-test"), |
| 291 | `node flag not forwarded to child execArgv: ${JSON.stringify(dump.execArgv)}`, |
| 292 | ); |
| 293 | }); |
| 294 |
| 295 | it("should forward node flags while consuming its own flags", () => { |
| 296 | // --reload is ours (→ env, not forwarded); --title is Node's (→ execArgv). |
| 297 | const dump = runDump(["--reload", "--title=node-url-import-test"]); |
| 298 | assert.equal(dump.env.RELOAD, "1"); |
| 299 | assert.ok(dump.execArgv.includes("--title=node-url-import-test")); |
| 300 | assert.ok(!dump.execArgv.includes("--reload")); |
| 301 | }); |
| 302 |
| 303 | it("keeps -r as Node's CommonJS preload and does not enable reload", () => { |
| 304 | const preload = join(fixtureDir, "preload.cjs"); |
| 305 | writeFileSync(preload, 'process.env.CLI_PRELOADED = "1";'); |
| 306 | const result = runCli(["--tmp", "-r", preload, "-p", 'JSON.stringify({ preloaded: process.env.CLI_PRELOADED, reload: process.env.URL_IMPORT_RELOAD, tmp: process.env.URL_IMPORT_TMP, execArgv: process.execArgv })']); |
| 307 | assert.equal(result.status, 0, result.stderr); |
| 308 | const output = JSON.parse(result.stdout); |
| 309 | assert.equal(output.preloaded, "1"); |
| 310 | assert.equal(output.reload, undefined); |
| 311 | assert.equal(output.tmp, "1"); |
| 312 | assert.equal(output.execArgv[output.execArgv.indexOf("-r") + 1], preload); |
| 313 | }); |
| 314 |
| 315 | it("does not inherit a remote main entry when a local script is selected", () => { |
| 316 | const result = runCli([dumpScript], { URL_IMPORT_MAIN: "https://example.invalid/old-entry.mjs" }); |
| 317 | assert.equal(result.status, 0, result.stderr); |
| 318 | assert.equal(JSON.parse(result.stdout).env.MAIN, undefined); |
| 319 | }); |
| 320 |
| 321 | it("preserves required Node option values after consuming leading own options", () => { |
| 322 | const dump = runDump(["--tmp", "--title", "test-title", "--conditions", "test-condition"]); |
| 323 | assert.equal(dump.env.TMP, "1"); |
| 324 | assert.deepEqual(dump.argv, []); |
| 325 | const titleIndex = dump.execArgv.indexOf("--title"); |
| 326 | const conditionIndex = dump.execArgv.indexOf("--conditions"); |
| 327 | assert.equal(dump.execArgv[titleIndex + 1], "test-title"); |
| 328 | assert.equal(dump.execArgv[conditionIndex + 1], "test-condition"); |
| 329 | }); |
| 330 |
| 331 | it("forwards Node preload and environment-file values", () => { |
| 332 | const preload = join(fixtureDir, "preload.mjs"); |
| 333 | const envFile = join(fixtureDir, "runtime.env"); |
| 334 | writeFileSync(preload, ""); |
| 335 | writeFileSync(envFile, "CLI_TEST_VALUE=fixture\n"); |
| 336 | const dump = runDump(["--import", preload, "--env-file", envFile]); |
| 337 | const preloadIndex = dump.execArgv.lastIndexOf("--import"); |
| 338 | const envIndex = dump.execArgv.indexOf("--env-file"); |
| 339 | assert.equal(dump.execArgv[preloadIndex + 1], preload); |
| 340 | assert.equal(dump.execArgv[envIndex + 1], envFile); |
| 341 | }); |
| 342 |
| 343 | it("stops consuming own options when Node's arguments start", () => { |
| 344 | const args = ["--title", "test-title", "--tmp", dumpScript]; |
| 345 | const expected = spawnSync(process.execPath, args, { encoding: "utf8", input: "" }); |
| 346 | const result = runCli(args); |
| 347 | assert.notEqual(expected.status, 0); |
| 348 | assert.equal(result.status, expected.status); |
| 349 | assert.equal(result.stdout, expected.stdout); |
| 350 | }); |
| 351 |
| 352 | it("does not consume the script as an optional inspector value", () => { |
| 353 | const dump = runDump(["--inspect"]); |
| 354 | assert.ok(dump.execArgv.includes("--inspect")); |
| 355 | assert.deepEqual(dump.argv, []); |
| 356 | }); |
| 357 | }); |
| 358 |
| 359 | describe("CLI: --cdn bare-specifier resolution", () => { |
| 360 | it("should resolve a bare specifier via the CDN and keep node built-ins local", () => { |
| 361 | const scriptPath = join(fixtureDir, "cdn-bare.mjs"); |
| 362 | writeFileSync( |
| 363 | scriptPath, |
| 364 | // `ms` is a bare npm package (→ CDN); `node:path` is a built-in (→ local). |
| 365 | `import ms from "ms";\n` + |
| 366 | `import { join } from "node:path";\n` + |
| 367 | `console.log(JSON.stringify({ ms: ms(1000), join: typeof join }));\n`, |
| 368 | "utf-8", |
| 369 | ); |
| 370 |
| 371 | const result = runCli(["--cdn", scriptPath]); |
| 372 | assert.equal(result.status, 0, `stderr: ${result.stderr}`); |
| 373 | const out = JSON.parse(result.stdout.trim()); |
| 374 | assert.equal(out.ms, "1s"); |
| 375 | assert.equal(out.join, "function"); |
| 376 | }); |
| 377 |
| 378 | it("should fail to resolve a bare specifier without --cdn", () => { |
| 379 | const scriptPath = join(fixtureDir, "no-cdn-bare.mjs"); |
| 380 | writeFileSync(scriptPath, `import "ms";\n`, "utf-8"); |
| 381 | const result = runCli([scriptPath]); |
| 382 | assert.notEqual(result.status, 0); |
| 383 | assert.ok( |
| 384 | /ERR_MODULE_NOT_FOUND|Cannot find package/.test(result.stderr), |
| 385 | `Expected module-not-found, got: ${result.stderr}`, |
| 386 | ); |
| 387 | }); |
| 388 | }); |
| 389 |
| 390 | describe("CLI: exit code propagation", () => { |
| 391 | it("preserves the target's signal exit status", { skip: process.platform === "win32" }, () => { |
| 392 | const result = runCli(["--eval", 'process.kill(process.pid, "SIGTERM");']); |
| 393 | assert.equal(result.status, null); |
| 394 | assert.equal(result.signal, "SIGTERM"); |
| 395 | }); |
| 396 |
| 397 | it("forwards termination signals to the target instead of orphaning it", { skip: process.platform === "win32" }, async () => { |
| 398 | const scriptPath = join(fixtureDir, "signal.mjs"); |
| 399 | const sentinelPath = join(fixtureDir, "terminated"); |
| 400 | writeFileSync(scriptPath, ` |
| 401 | import { writeFileSync } from "node:fs"; |
| 402 | process.on("SIGTERM", () => { writeFileSync(${JSON.stringify(sentinelPath)}, "stopped"); process.exit(0); }); |
| 403 | console.log(process.pid); |
| 404 | setInterval(() => {}, 1000); |
| 405 | `); |
| 406 | const child = spawn(process.execPath, ["src/cli.ts", scriptPath], { |
| 407 | env: { ...process.env, DENO_DIR: join(fixtureDir, "deno") }, |
| 408 | stdio: ["ignore", "pipe", "pipe"], timeout: 5_000, killSignal: "SIGKILL", |
| 409 | }); |
| 410 | const completed = new Promise<{ status: number | null; signal: NodeJS.Signals | null }>((resolve, reject) => { |
| 411 | child.on("error", reject); |
| 412 | child.on("exit", (status, signal) => resolve({ status, signal })); |
| 413 | }); |
| 414 | let targetPid: number | undefined; |
| 415 | try { |
| 416 | assert.ok(child.stdout); |
| 417 | const [output] = await once(child.stdout, "data", { signal: AbortSignal.timeout(3_000) }); |
| 418 | targetPid = Number(String(output).trim()); |
| 419 | assert.ok(Number.isInteger(targetPid) && targetPid > 0); |
| 420 | child.kill("SIGTERM"); |
| 421 | const result = await completed; |
| 422 | assert.equal(result.status, 0); |
| 423 | assert.equal(result.signal, null); |
| 424 | assert.equal(readFileSync(sentinelPath, "utf8"), "stopped"); |
| 425 | } finally { |
| 426 | if (child.exitCode === null && child.signalCode === null) child.kill("SIGKILL"); |
| 427 | if (targetPid) { |
| 428 | try { process.kill(targetPid, "SIGKILL"); } catch { /* Target already exited. */ } |
| 429 | } |
| 430 | } |
| 431 | }); |
| 432 |
| 433 | it("should propagate a non-zero exit code from the target script", () => { |
| 434 | const exitScript = join(fixtureDir, "exit.mjs"); |
| 435 | writeFileSync(exitScript, "process.exit(3);\n", "utf-8"); |
| 436 | const result = runCli([exitScript]); |
| 437 | assert.equal(result.status, 3); |
| 438 | }); |
| 439 |
| 440 | it("should exit 0 when the target script succeeds", () => { |
| 441 | const okScript = join(fixtureDir, "ok.mjs"); |
| 442 | writeFileSync(okScript, "process.exit(0);\n", "utf-8"); |
| 443 | const result = runCli([okScript]); |
| 444 | assert.equal(result.status, 0); |
| 445 | }); |
| 446 | }); |
| 447 |
| 448 |