Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeSureNoAppIsSelected is inaccurate for ng test -a app-name #325

Closed
emilio-martinez opened this issue Mar 12, 2018 · 3 comments
Closed
Labels
community This is a good first issue for contributing outdated type: bug

Comments

@emilio-martinez
Copy link
Contributor

makeSureNoAppIsSelected() correctly verifies passed arguments as long as they're formulated as -a=app-name or --app=app-name. However, arguments are missed if they're formulated without the equal sign after the argument key, i.e., -a app-name or --app app-name.

That syntax, both with and without the equals sign after the argument key, is valid, as shown in Angular CLI's "Multiple Apps integration" story.

See reference below to where the equal sign is being explicitly sought out as part of the argument.

export function makeSureNoAppIsSelected() {
if (findAppArg()) {
console.error('Nx only supports running unit tests for all apps and libs.');
console.error('You cannot use -a or --app.');
console.error('Use fdescribe or fit to select a subset of tests to run.');
process.exit(1);
}
}
function findAppArg() {
return process.argv.filter(
a =>
a.startsWith(`-a=`) ||
a.startsWith(`--app=`) ||
a.startsWith(`"-a="`) ||
a.startsWith(`"--app="`) ||
a.startsWith(`'-a='`) ||
a.startsWith(`'--app='`)
)[0];

@Yonet Yonet added type: bug scope: schematics community This is a good first issue for contributing labels Mar 16, 2018
@FrozenPandaz
Copy link
Collaborator

I can take this

@FrozenPandaz
Copy link
Collaborator

This should no longer be an issue as of 0.10.0.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated type: bug
Projects
None yet
Development

No branches or pull requests

4 participants