diff --git a/packages/@angular/cli/commands/completion.ts b/packages/@angular/cli/commands/completion.ts index 1147c7e48f6b..b755ab49ee0d 100644 --- a/packages/@angular/cli/commands/completion.ts +++ b/packages/@angular/cli/commands/completion.ts @@ -78,7 +78,7 @@ const CompletionCommand = Command.extend({ commandOptions.all = !commandOptions.bash && !commandOptions.zsh; const commandFiles = fs.readdirSync(__dirname) - .filter(file => file.match(/\.ts$/) && !file.match(/\.run.ts$/)) + .filter(file => file.match(/\.(j|t)s$/) && !file.match(/\.d.ts$/)) .map(file => path.parse(file).name) .filter(file => { return commandsToIgnore.indexOf(file) < 0; diff --git a/tests/e2e/tests/commands/completion/completion.ts b/tests/e2e/tests/commands/completion/completion.ts new file mode 100644 index 000000000000..b88821e8c3ab --- /dev/null +++ b/tests/e2e/tests/commands/completion/completion.ts @@ -0,0 +1,9 @@ +import {silentNg} from '../../../utils/process'; + + +export default function() { + return Promise.resolve() + .then(() => silentNg('completion')) + .then(() => process.chdir('/')) + .then(() => silentNg('completion')); +}