Skip to content

Commit

Permalink
chore: stub reporter in console test
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed May 8, 2024
1 parent f2e15f7 commit 2c19d35
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/reporters/tests/console.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import { resolve } from 'pathe'
import { expect, test } from 'vitest'
import { DefaultReporter } from 'vitest/reporters'
import { runVitest } from '../../test-utils'

class LogReporter extends DefaultReporter {
isTTY = true
renderer = {
start() {},
update() {},
stop() {},
clear() {},
}
}

test('should print logs correctly', async () => {
const filename = resolve('./fixtures/console.test.ts')
const { stdout, stderr } = await runVitest({ root: './fixtures', reporters: ['dot'] }, [filename])

const { stdout, stderr } = await runVitest({
root: './fixtures',
reporters: [new LogReporter() as any],
}, [filename])

expect(stdout).toBeTruthy()
expect(stderr).toBeTruthy()
Expand Down

0 comments on commit 2c19d35

Please sign in to comment.