From 9b332316ab0691db1772e6d3e531a0b95367e22a Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Wed, 27 Mar 2024 08:44:41 +0300 Subject: [PATCH] feat: set `$.verbose` to false by default closes #569 --- src/core.ts | 2 +- test/cli.test.js | 1 - test/core.test.js | 6 ------ test/deps.test.js | 4 ---- test/experimental.test.js | 6 +----- test/goods.test.js | 4 ---- test/package.test.js | 1 - test/win32.test.js | 4 ---- 8 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/core.ts b/src/core.ts index 272e5f4b37b..c3ad15ccef8 100644 --- a/src/core.ts +++ b/src/core.ts @@ -83,7 +83,7 @@ hook.enable() export const defaults: Options = { [processCwd]: process.cwd(), [syncExec]: false, - verbose: true, + verbose: false, env: process.env, sync: false, shell: true, diff --git a/test/cli.test.js b/test/cli.test.js index f4d3c58f1f4..e036e41073f 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -21,7 +21,6 @@ describe('cli', () => { let promiseResolved = false beforeEach(() => { - $.verbose = false process.on('exit', () => { if (!promiseResolved) { console.error('Error: ProcessPromise never resolved.') diff --git a/test/core.test.js b/test/core.test.js index 5df3a2eb7cd..7ee0c32d260 100644 --- a/test/core.test.js +++ b/test/core.test.js @@ -21,10 +21,6 @@ import { ProcessPromise, ProcessOutput } from '../build/index.js' import '../build/globals.js' describe('core', () => { - beforeEach(() => { - $.verbose = false - }) - test('only stdout is used during command substitution', async () => { let hello = await $`echo Error >&2; echo Hello` let len = +(await $`echo ${hello} | wc -c`) @@ -340,7 +336,6 @@ describe('core', () => { resolve() } - $.verbose = false assert.equal($.verbose, false) within(() => { @@ -364,7 +359,6 @@ describe('core', () => { let pwd = await $`pwd` within(async () => { - $.verbose = false cd('/tmp') setTimeout(async () => { assert.ok((await $`pwd`).stdout.trim().endsWith('/tmp')) diff --git a/test/deps.test.js b/test/deps.test.js index 3755d68e7dc..0e63c640aab 100644 --- a/test/deps.test.js +++ b/test/deps.test.js @@ -18,10 +18,6 @@ import { $ } from '../build/index.js' import { installDeps, parseDeps } from '../build/deps.js' describe('deps', () => { - beforeEach(() => { - $.verbose = false - }) - test('installDeps() loader works via JS API', async () => { await installDeps({ cpy: '9.0.1', diff --git a/test/experimental.test.js b/test/experimental.test.js index bc55de33254..2a3d60e511c 100644 --- a/test/experimental.test.js +++ b/test/experimental.test.js @@ -15,8 +15,4 @@ import { describe, before } from 'node:test' import '../build/globals.js' -describe('experimental', () => { - before(() => { - $.verbose = false - }) -}) +describe('experimental', () => {}) diff --git a/test/goods.test.js b/test/goods.test.js index e7be2cd9fd1..996b8b0c293 100644 --- a/test/goods.test.js +++ b/test/goods.test.js @@ -18,10 +18,6 @@ import { test, describe, beforeEach } from 'node:test' import '../build/globals.js' describe('goods', () => { - beforeEach(() => { - $.verbose = false - }) - function zx(script) { return $`node build/cli.js --eval ${script}`.nothrow().timeout('5s') } diff --git a/test/package.test.js b/test/package.test.js index 1b3b4b8cca5..0bd76532c7c 100644 --- a/test/package.test.js +++ b/test/package.test.js @@ -18,7 +18,6 @@ import '../build/globals.js' describe('package', () => { beforeEach(async () => { - $.verbose = false const pack = await $`npm pack` await $`tar xf ${pack}` await $`rm ${pack}`.nothrow() diff --git a/test/win32.test.js b/test/win32.test.js index 7c63de9a719..e1299ffe4c7 100644 --- a/test/win32.test.js +++ b/test/win32.test.js @@ -19,10 +19,6 @@ import '../build/globals.js' const _describe = process.platform === 'win32' ? describe : describe.skip _describe('win32', () => { - beforeEach(() => { - $.verbose = false - }) - test('should work with windows-specific commands', async () => { const p = await $`echo $0` // Bash is first by default. assert.match(p.stdout, /bash/)