Skip to content

Commit

Permalink
fix(@angular/cli): remove default for test runners
Browse files Browse the repository at this point in the history
These are specified in the config file and defaulting them in CLI makes karma.conf.js useless.
  • Loading branch information
ishitatsuyuki authored and filipesilva committed May 4, 2017
1 parent 8d8c5de commit e7966a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/documentation/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 3 additions & 5 deletions packages/@angular/cli/commands/test.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -33,7 +33,6 @@ const TestCommand = Command.extend({
{
name: 'watch',
type: Boolean,
default: true,
aliases: ['w'],
description: 'Run build when files change.'
},
Expand All @@ -54,7 +53,6 @@ const TestCommand = Command.extend({
{
name: 'single-run',
type: Boolean,
default: false,
aliases: ['sr'],
description: 'Run tests a single time.'
},
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e7966a2

Please sign in to comment.