File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ const hook = createHook({
5959} )
6060hook . enable ( )
6161
62- const defaults : Options = {
62+ export const defaults : Options = {
6363 [ processCwd ] : process . cwd ( ) ,
64- verbose : ( global as any ) . ZX_VERBOSE ?? true ,
64+ verbose : true ,
6565 env : process . env ,
6666 shell : true ,
6767 prefix : '' ,
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ import os from 'node:os'
1717import path from 'node:path'
1818import repl from 'node:repl'
1919import { inspect } from 'node:util'
20- import { ProcessOutput } from './core.js'
20+ import { ProcessOutput , defaults } from './core.js'
2121
2222export function startRepl ( ) {
23- ; ( global as any ) . ZX_VERBOSE = false
23+ defaults . verbose = false
2424 const r = repl . start ( {
2525 prompt : chalk . greenBright . bold ( '❯ ' ) ,
2626 useGlobal : true ,
Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ test('starts repl with -i', async () => {
6262 assert . match ( out . stdout , 'bar' )
6363} )
6464
65+ test ( 'starts repl with verbosity off' , async ( ) => {
66+ let p = $ `node build/cli.js -i`
67+ p . stdin . write ( '"verbose" + " is " + $.verbose\n' )
68+ p . stdin . end ( )
69+ let out = await p
70+ assert . match ( out . stdout , 'verbose is false' )
71+ } )
72+
6573test ( 'supports `--experimental` flag' , async ( ) => {
6674 let out = await $ `echo 'echo("test")' | node build/cli.js --experimental`
6775 assert . match ( out . stdout , 'test' )
You can’t perform that action at this time.
0 commit comments