Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular/cli/src/command-builder/command-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis
hidden: true,
type: 'boolean',
})
.help('help', 'Shows a help message for this command in the console.')
.help(help, help ? 'Shows a help message for this command in the console.' : undefined)
// A complete list of strings can be found: https://github.com/yargs/yargs/blob/main/locales/en.json
.updateStrings({
'Commands:': colors.cyan('Commands:'),
Expand Down
27 changes: 14 additions & 13 deletions tests/e2e/tests/generate/component/component-basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ import { join } from 'node:path';
import { ng } from '../../../utils/process';
import { expectFileToExist } from '../../../utils/fs';

export default function () {
const projectDir = join('src', 'app');
const componentDir = join(projectDir, 'test-component');
export default async function () {
const componentDir = 'src/app/test-component';

return (
ng('generate', 'component', 'test-component')
.then(() => expectFileToExist(componentDir))
.then(() => expectFileToExist(join(componentDir, 'test-component.ts')))
.then(() => expectFileToExist(join(componentDir, 'test-component.spec.ts')))
.then(() => expectFileToExist(join(componentDir, 'test-component.html')))
.then(() => expectFileToExist(join(componentDir, 'test-component.css')))
await ng('generate', 'component', 'test-component');
await expectFileToExist(componentDir);
await expectFileToExist(join(componentDir, 'test-component.ts'));
await expectFileToExist(join(componentDir, 'test-component.spec.ts'));
await expectFileToExist(join(componentDir, 'test-component.html'));
await expectFileToExist(join(componentDir, 'test-component.css'));

// Try to run the unit tests.
.then(() => ng('test', '--watch=false'))
);
// Try to run the unit tests.
await ng('test', '--watch=false');

// Should generate component that is named "help".
await ng('generate', 'component', 'help');
await expectFileToExist('src/app/help/help.ts');
}
Loading