Skip to content

Commit

Permalink
one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain committed Nov 16, 2022
1 parent 8b59806 commit 3b84dd5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/@aws-cdk/integ-runner/test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ import * as path from 'path';
import { main, parseCliArgs } from '../lib/cli';

let stdoutMock: jest.SpyInstance;
let stderrMock: jest.SpyInstance;
beforeEach(() => {
stdoutMock = jest.spyOn(process.stdout, 'write').mockImplementation(() => { return true; });
stderrMock = jest.spyOn(process.stderr, 'write').mockImplementation(() => { return true; });
});
afterEach(() => {
stdoutMock.mockRestore();
stderrMock.mockRestore();
});

describe('CLI', () => {
Expand Down Expand Up @@ -100,4 +97,13 @@ describe('CLI config file', () => {
'ap-southeast-2',
]);
});
});

test('cli options take precedent', async () => {
// WHEN
withConfig({ maxWorkers: 3 });
const options = parseCliArgs(['--max-workers', '20']);

// THEN
expect(options.maxWorkers).toBe(20);
});
});

0 comments on commit 3b84dd5

Please sign in to comment.