Matt Briggs bebc71a714 feat(nx): add run-many
This adds a run-many command to:

 - make more semantic sense for the --all option
 - to add the ability to specify specific projects to run

It also involves a quite substancial refactoring of affected.ts in order
to attempt reuse of the code in both commands
2019-11-15 18:59:05 -05:00

52 lines
968 B
TypeScript

import { splitArgs } from './utils';
describe('splitArgs', () => {
it('should split nx specific arguments into nxArgs', () => {
expect(
splitArgs(
{
files: [''],
notNxArg: true,
_: ['--override'],
$0: ''
},
['files']
).nxArgs
).toEqual({
files: ['']
});
});
it('should split non nx specific arguments into target args', () => {
expect(
splitArgs(
{
files: [''],
notNxArg: true,
_: ['--override'],
$0: ''
},
['files']
).targetArgs
).toEqual({
notNxArg: true
});
});
it('should split delimited args into task overrides', () => {
expect(
splitArgs(
{
files: [''],
notNxArg: true,
_: ['', '--override'],
$0: ''
},
['files']
).overrides
).toEqual({
override: true
});
});
});