Skip to content

Commit 37cc269

Browse files
authored
fix(reporter): invisible CLI menus when vitest --standalone (#8248)
1 parent 932d837 commit 37cc269

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/vitest/src/node/reporters/renderers/windowedRenderer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class WindowRenderer {
3030
private renderScheduled = false
3131

3232
private windowHeight = 0
33+
private started = false
3334
private finished = false
3435
private cleanups: (() => void)[] = []
3536

@@ -54,11 +55,10 @@ export class WindowRenderer {
5455
this.flushBuffer()
5556
this.stop()
5657
})
57-
58-
this.start()
5958
}
6059

6160
start(): void {
61+
this.started = true
6262
this.finished = false
6363
this.renderInterval = setInterval(() => this.schedule(), this.options.interval).unref()
6464
}
@@ -171,7 +171,7 @@ export class WindowRenderer {
171171
// @ts-expect-error -- not sure how 2 overloads should be typed
172172
stream.write = (chunk, _, callback) => {
173173
if (chunk) {
174-
if (this.finished) {
174+
if (this.finished || !this.started) {
175175
this.write(chunk.toString(), type)
176176
}
177177
else {

0 commit comments

Comments
 (0)