Skip to content

Commit

Permalink
test: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jun 22, 2023
1 parent 18eb936 commit 9e4101c
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions test/reporters/tests/default.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,19 @@ describe('default reporter', async () => {
await vitest.waitForStdout('Input filename pattern')
vitest.write('watch/b\n')
await vitest.waitForStdout('PASS Waiting for file changes...')
expect(vitest.stdout).toMatchInlineSnapshot(`
"? Input filename pattern › w? Input filename pattern › wa? Input filename pattern › wat? Input filename pattern › watc? Input filename pattern › watch? Input filename pattern › watch/? Input filename pattern › watch/b✔ Input filename pattern … watch/b
RERUN ../../change filename pattern
Filename pattern: watch/b

expect(vitest.stdout).toContain('RERUN')
expect(vitest.stdout).toContain('b1.test.ts')
expect(vitest.stdout).toContain('b2.test.ts')
expect(vitest.stdout).not.toContain('nested b1 test')
expect(vitest.stdout.split('\n').slice(3, -6).join('\n')).toMatchInlineSnapshot(`
"
✓ watch/b2.test.ts (6)
✓ watch/b1.test.ts (6)
Test Files 2 passed (2)
Tests 12 passed (12)
Start at 14:58:48
Duration 9ms
PASS Waiting for file changes...
press h to show help, press q to quit
"
Tests 12 passed (12)"
`)
expect(vitest.stdout).toContain('RERUN')
expect(vitest.stdout).toContain('b1.test.ts')
expect(vitest.stdout).toContain('b2.test.ts')
expect(vitest.stdout).not.toContain('nested b1 test')
expect(vitest.stdout).not.toContain('b1 test')
expect(vitest.stdout).not.toContain('b2 test')
})
Expand Down

0 comments on commit 9e4101c

Please sign in to comment.