Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjamin committed Jun 8, 2023
1 parent 6569a94 commit 9017055
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/__tests__/runner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,32 @@ describe('Runner', () => {
expect(args[0]).toBe(expected);
});

it('converts user passed in args', () => {
const expected = '--foo-bar-baz';

const workspace: any = {useDashedArgs: true};
const options = {args: {args: ['--fooBarBaz']}};
const sut = new Runner(workspace, options);
sut.start(false);

const args = (createProcess: any).mock.calls[0][1];
const index = args.indexOf(expected);
expect(index).not.toBe(-1);
});

it('does not alter already dashed args when provided', () => {
const expected = '--foo-bar-baz';

const workspace: any = {useDashedArgs: true};
const options = {args: {args: [expected]}};
const sut = new Runner(workspace, options);
sut.start(false);

const args = (createProcess: any).mock.calls[0][1];
const index = args.indexOf(expected);
expect(index).not.toBe(-1);
});

describe('RunArgs', () => {
it.each`
runArgs | containedArgs
Expand Down

0 comments on commit 9017055

Please sign in to comment.