File tree 2 files changed +3
-2
lines changed
packages/vitest/src/runtime/workers
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export async function runVmTests(state: WorkerGlobalState) {
48
48
// because browser doesn't provide these globals
49
49
context . process = process
50
50
context . global = context
51
- context . console = createCustomConsole ( state )
51
+ context . console = state . config . disableConsoleIntercept ? console : createCustomConsole ( state )
52
52
// TODO: don't hardcode setImmediate in fake timers defaults
53
53
context . setImmediate = setImmediate
54
54
context . clearImmediate = clearImmediate
Original file line number Diff line number Diff line change @@ -8,10 +8,11 @@ test('default intercept', async () => {
8
8
expect ( stderr ) . toBe ( 'stderr | basic.test.ts > basic\n__test_console__\n\n' )
9
9
} )
10
10
11
- test ( ' disable intercept' , async ( ) => {
11
+ test . each ( [ 'threads' , 'vmThreads' ] as const ) ( ` disable intercept pool=%s` , async ( pool ) => {
12
12
const { stderr } = await runVitest ( {
13
13
root : './fixtures/console' ,
14
14
disableConsoleIntercept : true ,
15
+ pool,
15
16
} )
16
17
expect ( stderr ) . toBe ( '__test_console__\n' )
17
18
} )
You can’t perform that action at this time.
0 commit comments