Skip to content

Commit e0f45cb

Browse files
fix: use TTY reporter when running in Deno (#5972)
1 parent 2a2c908 commit e0f45cb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/vitest/src/node/reporters/base.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
hasFailed,
1919
hasFailedSnapshot,
2020
isCI,
21+
isDeno,
2122
isNode,
2223
relativePath,
2324
toArray,
@@ -75,7 +76,7 @@ export abstract class BaseReporter implements Reporter {
7576
private _offUnhandledRejection?: () => void
7677

7778
constructor(options: BaseOptions = {}) {
78-
this.isTTY = options.isTTY ?? (isNode && process.stdout?.isTTY && !isCI)
79+
this.isTTY = options.isTTY ?? ((isNode || isDeno) && process.stdout?.isTTY && !isCI)
7980
this.registerUnhandledRejection()
8081
}
8182

packages/vitest/src/utils/env.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ export const isNode: boolean
33
&& typeof process.stdout < 'u'
44
&& !process.versions?.deno
55
&& !globalThis.window
6-
export const isWindows = isNode && process.platform === 'win32'
6+
export const isDeno: boolean
7+
= typeof process < 'u'
8+
&& typeof process.stdout < 'u'
9+
&& process.versions?.deno !== undefined
10+
export const isWindows = (isNode || isDeno) && process.platform === 'win32'
711
export const isBrowser: boolean = typeof window !== 'undefined'
812
export { isCI, provider as stdProvider } from 'std-env'

0 commit comments

Comments
 (0)