diff --git a/src/goods.ts b/src/goods.ts index d1afb0aa17..d7b581f824 100644 --- a/src/goods.ts +++ b/src/goods.ts @@ -27,10 +27,10 @@ import { export { default as path } from 'node:path' export * as os from 'node:os' -export let argv = minimist(process.argv.slice(2)) +export const argv = minimist(process.argv.slice(2)) export function updateArgv(args: string[]) { - argv = minimist(args) - ;(global as any).argv = argv + for (var k in argv) delete argv[k] + Object.assign(argv, minimist(args)) } export function sleep(duration: Duration) { diff --git a/test/goods.test.js b/test/goods.test.js index 996b8b0c29..6c520311b9 100644 --- a/test/goods.test.js +++ b/test/goods.test.js @@ -14,7 +14,7 @@ import chalk from 'chalk' import assert from 'node:assert' -import { test, describe, beforeEach } from 'node:test' +import { test, describe } from 'node:test' import '../build/globals.js' describe('goods', () => {