Skip to content

Commit

Permalink
test: move to separate test
Browse files Browse the repository at this point in the history
  • Loading branch information
fenghan34 committed Feb 26, 2024
1 parent f07075c commit e6e182a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/core/test/cli-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ test('cache is parsed correctly', () => {
})
})

test('shuffle is parsed correctly', () => {
expect(getCLIOptions('--sequence.shuffle')).toEqual({ sequence: { shuffle: true } })
expect(getCLIOptions('--sequence.shuffle=false')).toEqual({ sequence: { shuffle: false } })
expect(getCLIOptions('--sequence.shuffle.files --sequence.shuffle.tests')).toEqual({ sequence: { shuffle: { files: true, tests: true } } })
expect(getCLIOptions('--sequence.shuffle.files=false --sequence.shuffle.tests=false')).toEqual({ sequence: { shuffle: { files: false, tests: false } } })
})

test('typecheck correctly passes down arguments', () => {
const { options, args } = parseArguments('--typecheck some.name.ts')
expect(options).toEqual({ typecheck: { enabled: true } })
Expand Down Expand Up @@ -330,13 +337,4 @@ test('public parseCLI works correctly', () => {
'color': true,
},
})

expect(parseCLI('vitest --sequence.shuffle.files --sequence.shuffle.tests=false')).toEqual({
filter: [],
options: {
'sequence': { shuffle: { files: true, tests: false } },
'--': [],
'color': true,
},
})
})

0 comments on commit e6e182a

Please sign in to comment.