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
52 lines
968 B
TypeScript
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
|
|
});
|
|
});
|
|
});
|