-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
flags.test.ts
38 lines (37 loc) · 919 Bytes
/
flags.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { expect, it } from 'vitest'
import { runVitest } from '../../test-utils'
it('correctly inherit from the cli', async () => {
const { vitest } = await runVitest({
root: 'fixtures/workspace-flags',
logHeapUsage: true,
allowOnly: true,
sequence: {
seed: 123,
},
testTimeout: 5321,
pool: 'forks',
globals: true,
expandSnapshotDiff: true,
retry: 6,
testNamePattern: 'math',
passWithNoTests: true,
bail: 100,
})
const project = vitest!.projects[0]
const config = project.getSerializableConfig()
expect(config).toMatchObject({
logHeapUsage: true,
allowOnly: true,
sequence: expect.objectContaining({
seed: 123,
}),
testTimeout: 5321,
pool: 'forks',
globals: true,
expandSnapshotDiff: true,
retry: 6,
passWithNoTests: true,
bail: 100,
})
expect(config.testNamePattern?.test('math')).toBe(true)
})