Skip to content

Commit d98a6dd

Browse files
committed
fixup!: make explicit and cleanup test
1 parent fcc8086 commit d98a6dd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/node/cli.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
542542
args.password = process.env.PASSWORD
543543
}
544544

545-
if (process.env.CS_DISABLE_FILE_DOWNLOADS) {
545+
if (process.env.CS_DISABLE_FILE_DOWNLOADS === "1") {
546546
args["disable-file-downloads"] = true
547547
}
548548

@@ -560,7 +560,6 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
560560
delete process.env.PASSWORD
561561
delete process.env.HASHED_PASSWORD
562562
delete process.env.GITHUB_TOKEN
563-
delete process.env.CS_DISABLE_FILE_DOWNLOADS
564563

565564
// Filter duplicate proxy domains and remove any leading `*.`.
566565
const proxyDomains = new Set((args["proxy-domain"] || []).map((d) => d.replace(/^\*\./, "")))

test/unit/node/cli.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ describe("parser", () => {
350350
})
351351

352352
it("should use env var CS_DISABLE_FILE_DOWNLOADS", async () => {
353-
process.env.CS_DISABLE_FILE_DOWNLOADS = "0"
353+
process.env.CS_DISABLE_FILE_DOWNLOADS = "1"
354354
const args = parse([])
355355
expect(args).toEqual({})
356356

@@ -359,6 +359,9 @@ describe("parser", () => {
359359
...defaults,
360360
"disable-file-downloads": true,
361361
})
362+
363+
// Cleanup
364+
delete process.env.CS_DISABLE_FILE_DOWNLOADS
362365
})
363366

364367
it("should error if password passed in", () => {

0 commit comments

Comments
 (0)