fix(@angular/cli): remove default for test runners

These are specified in the config file and defaulting them in CLI makes karma.conf.js useless.
This commit is contained in:
Tatsuyuki Ishi 2017-04-09 19:23:06 +09:00 committed by Filipe Silva
parent 8d8c5de080
commit e7966a2465
2 changed files with 4 additions and 6 deletions

View File

@ -119,7 +119,7 @@ You can run tests with coverage via `--code-coverage`. The coverage report will
<details>
<summary>single-run</summary>
<p>
<code>--single-run</code> (aliases: <code>-sr</code>) <em>default value: false</em>
<code>--single-run</code> (aliases: <code>-sr</code>)
</p>
<p>
Run tests a single time.

View File

@ -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;
}