|
1 | 1 | import { describe, expect, test } from 'vitest' |
2 | 2 | import { runVitest } from '../../test-utils' |
3 | 3 |
|
4 | | -describe('{ isTTY: true }', () => { |
5 | | - const isTTY = true |
6 | | - |
| 4 | +describe.each([true, false])('{ isTTY: %s }', (isTTY) => { |
7 | 5 | test('renders successful tests', async () => { |
8 | 6 | const { stdout, stderr } = await runVitest({ |
9 | 7 | include: ['./fixtures/ok.test.ts'], |
@@ -45,54 +43,3 @@ describe('{ isTTY: true }', () => { |
45 | 43 | expect(stderr).toContain('') |
46 | 44 | }) |
47 | 45 | }) |
48 | | - |
49 | | -describe('{ isTTY: false }', () => { |
50 | | - const isTTY = false |
51 | | - |
52 | | - test('renders successful tests', async () => { |
53 | | - const { stdout, stderr } = await runVitest({ |
54 | | - include: ['./fixtures/ok.test.ts'], |
55 | | - reporters: [['dot', { isTTY }]], |
56 | | - typecheck: undefined, |
57 | | - }) |
58 | | - |
59 | | - expect(stdout).toContain('✓ fixtures/ok.test.ts') |
60 | | - expect(stdout).toContain('Test Files 1 passed (1)') |
61 | | - expect(stdout).not.toContain('·') |
62 | | - |
63 | | - expect(stderr).toBe('') |
64 | | - }) |
65 | | - |
66 | | - test('renders failing tests', async () => { |
67 | | - const { stdout, stderr } = await runVitest({ |
68 | | - include: ['./fixtures/some-failing.test.ts'], |
69 | | - reporters: [['dot', { isTTY }]], |
70 | | - typecheck: undefined, |
71 | | - }) |
72 | | - |
73 | | - expect(stdout).toContain('❯ fixtures/some-failing.test.ts (2 tests | 1 failed)') |
74 | | - expect(stdout).toContain('✓ 2 + 3 = 5') |
75 | | - expect(stdout).toContain('× 3 + 3 = 7') |
76 | | - expect(stdout).not.toContain('\n·x\n') |
77 | | - |
78 | | - expect(stdout).toContain('Test Files 1 failed (1)') |
79 | | - expect(stdout).toContain('Tests 1 failed | 1 passed') |
80 | | - |
81 | | - expect(stderr).toContain('AssertionError: expected 6 to be 7 // Object.is equality') |
82 | | - }) |
83 | | - |
84 | | - test('renders skipped tests', async () => { |
85 | | - const { stdout, stderr } = await runVitest({ |
86 | | - include: ['./fixtures/all-skipped.test.ts'], |
87 | | - reporters: [['dot', { isTTY }]], |
88 | | - typecheck: undefined, |
89 | | - }) |
90 | | - |
91 | | - expect(stdout).toContain('↓ fixtures/all-skipped.test.ts (2 tests | 2 skipped)') |
92 | | - expect(stdout).toContain('Test Files 1 skipped (1)') |
93 | | - expect(stdout).toContain('Tests 1 skipped | 1 todo') |
94 | | - expect(stdout).not.toContain('\n--\n') |
95 | | - |
96 | | - expect(stderr).toContain('') |
97 | | - }) |
98 | | -}) |
0 commit comments