diff --git a/docs/documentation/test.md b/docs/documentation/test.md index dacf81a5960f..b198ab3666dd 100644 --- a/docs/documentation/test.md +++ b/docs/documentation/test.md @@ -119,7 +119,7 @@ You can run tests with coverage via `--code-coverage`. The coverage report will
single-run

- --single-run (aliases: -sr) default value: false + --single-run (aliases: -sr)

Run tests a single time. diff --git a/packages/@angular/cli/commands/test.ts b/packages/@angular/cli/commands/test.ts index 680efcc5b5eb..761a9b25334b 100644 --- a/packages/@angular/cli/commands/test.ts +++ b/packages/@angular/cli/commands/test.ts @@ -1,6 +1,6 @@ const Command = require('../ember-cli/lib/models/command'); import TestTask from '../tasks/test'; -import {CliConfig} from '../models/config'; +import { CliConfig } from '../models/config'; import { oneLine } from 'common-tags'; const config = CliConfig.fromProject() || CliConfig.fromGlobal(); @@ -33,7 +33,6 @@ const TestCommand = Command.extend({ { name: 'watch', type: Boolean, - default: true, aliases: ['w'], description: 'Run build when files change.' }, @@ -54,7 +53,6 @@ const TestCommand = Command.extend({ { name: 'single-run', type: Boolean, - default: false, aliases: ['sr'], description: 'Run tests a single time.' }, @@ -110,13 +108,13 @@ const TestCommand = Command.extend({ } ], - run: function(commandOptions: TestOptions) { + run: function (commandOptions: TestOptions) { const testTask = new TestTask({ ui: this.ui, project: this.project }); - if (!commandOptions.watch) { + if (commandOptions.watch !== undefined && !commandOptions.watch) { // if not watching ensure karma is doing a single run commandOptions.singleRun = true; }