Skip to content

Commit df04a2f

Browse files
committed
test: add cli test
1 parent 598638a commit df04a2f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { test } from "vitest"
2+
3+
test.for([...Array(20)].map((_, j) => j))('%i', (i) => {
4+
throw new Error(`error-${i}`)
5+
})

test/reporters/tests/junit.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { File, Suite, Task, TaskResult } from 'vitest'
22
import { resolve } from 'pathe'
33
import { expect, test } from 'vitest'
44
import { getDuration } from '../../../packages/vitest/src/node/reporters/junit'
5-
import { runVitest } from '../../test-utils'
5+
import { runVitest, runVitestCli } from '../../test-utils'
66

77
const root = resolve(__dirname, '../fixtures')
88

@@ -169,3 +169,13 @@ test.each([true, false])('addFileAttribute %s', async (t) => {
169169
})
170170
expect(stabilizeReport(stdout)).matchSnapshot()
171171
})
172+
173+
test('many errors without warning', async () => {
174+
const { stderr } = await runVitestCli(
175+
'run',
176+
'--reporter=junit',
177+
'--root',
178+
resolve(import.meta.dirname, '../fixtures/many-errors'),
179+
)
180+
expect(stderr).not.toContain('MaxListenersExceededWarning')
181+
})

0 commit comments

Comments
 (0)