···11+import { defineConfig } from 'vitest/config'
22+33+export default defineConfig({
44+ test: {
55+ reporters: 'verbose',
66+ include: ['test/**/*.test.*'],
77+88+ // For Windows CI mostly
99+ testTimeout: 30_000,
1010+1111+ // Test cases may have side effects, e.g. files under fixtures/ are modified on the fly to trigger file watchers
1212+ singleThread: true,
1313+ },
1414+})
+7
test/watch/fixtures/example.test.ts
···11+import { expect, test } from 'vitest'
22+33+import { getHelloWorld } from './example'
44+55+test('getHello', async () => {
66+ expect(getHelloWorld()).toBe('Hello world')
77+})
+3
test/watch/fixtures/example.ts
···11+export function getHelloWorld() {
22+ return 'Hello world'
33+}
+7
test/watch/fixtures/math.test.ts
···11+import { expect, test } from 'vitest'
22+33+import { sum } from './math'
44+55+test('sum', () => {
66+ expect(sum(1, 2)).toBe(3)
77+})
+3
test/watch/fixtures/math.ts
···11+export function sum(a: number, b: number) {
22+ return a + b
33+}
+15
test/watch/fixtures/vitest.config.ts
···11+import { defineConfig } from 'vitest/config'
22+33+// Patch stdin on the process so that we can fake it to seem like a real interactive terminal and pass the TTY checks
44+process.stdin.isTTY = true
55+process.stdin.setRawMode = () => process.stdin
66+77+export default defineConfig({
88+ test: {
99+ watch: true,
1010+ outputTruncateLength: 999,
1111+1212+ // This configuration is edited by tests
1313+ reporters: 'verbose',
1414+ },
1515+})