Skip to content

Commit 32747bb

Browse files
committed
fix(test): isolate real-world usage tests with explicit spy clearing
Add mockClear() calls at the start of "progress indicator pattern" and "table rendering" tests to ensure they run with clean spy state. These tests check absolute call counts and were accumulating calls from previous tests in the describe block on Node.js 24.
1 parent 9248988 commit 32747bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/stdio/stdout.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,8 @@ describe('stdio/stdout', () => {
528528
value: true,
529529
configurable: true,
530530
})
531+
// Clear spy to ensure this test runs in isolation
532+
getContext().writeSpy.mockClear()
531533
write('Loading...')
532534
clearLine()
533535
write('Loading... 50%')
@@ -555,6 +557,8 @@ describe('stdio/stdout', () => {
555557
})
556558

557559
it('should support table rendering', () => {
560+
// Clear spy to ensure this test runs in isolation
561+
getContext().writeSpy.mockClear()
558562
writeLine('Name | Age | City')
559563
writeLine('------------|-----|-------')
560564
writeLine('John Doe | 30 | NYC')

0 commit comments

Comments
 (0)