Skip to content

Commit

Permalink
Modify extra arguments test to improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjtc committed Nov 8, 2023
1 parent cc15dc7 commit 44bae0d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/util/getCliOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ describe('getCliOptions', () => {

it('handles extra arguments correctly', () => {
jest.spyOn(cliHelper, 'getParsedCliOptions').mockReturnValue({
options: { version: true, cache: false, coverageDirectory: './test' },
options: { version: true, cache: false, env: 'node' },
extraArgs: ['--watch', '--coverage'],
});
const opts = getCliOptions();
expect(opts.jestOptions).toEqual(['--version', '--no-cache', '--watch', '--coverage']);
expect(opts.jestOptions).toEqual([
'--version',
'--no-cache',
'--env="node"',
'--watch',
'--coverage',
]);
});

it('returns extra args if passed', () => {
Expand Down

0 comments on commit 44bae0d

Please sign in to comment.