Skip to content

Commit

Permalink
feat: set $.verbose to false by default
Browse files Browse the repository at this point in the history
closes #569
  • Loading branch information
antongolub committed Mar 27, 2024
1 parent 6234c13 commit 9b33231
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe('cli', () => {
let promiseResolved = false

beforeEach(() => {
$.verbose = false
process.on('exit', () => {
if (!promiseResolved) {
console.error('Error: ProcessPromise never resolved.')
Expand Down
6 changes: 0 additions & 6 deletions test/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down Expand Up @@ -340,7 +336,6 @@ describe('core', () => {
resolve()
}

$.verbose = false
assert.equal($.verbose, false)

within(() => {
Expand All @@ -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'))
Expand Down
4 changes: 0 additions & 4 deletions test/deps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 1 addition & 5 deletions test/experimental.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@
import { describe, before } from 'node:test'
import '../build/globals.js'

describe('experimental', () => {
before(() => {
$.verbose = false
})
})
describe('experimental', () => {})
4 changes: 0 additions & 4 deletions test/goods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
1 change: 0 additions & 1 deletion test/package.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 0 additions & 4 deletions test/win32.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down

0 comments on commit 9b33231

Please sign in to comment.