Skip to content

Commit 9da5495

Browse files
ishitatsuyukifilipesilva
authored andcommitted
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.
1 parent 80207ba commit 9da5495

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

docs/documentation/test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ You can run tests with coverage via `--code-coverage`. The coverage report will
119119
<details>
120120
<summary>single-run</summary>
121121
<p>
122-
<code>--single-run</code> (aliases: <code>-sr</code>) <em>default value: false</em>
122+
<code>--single-run</code> (aliases: <code>-sr</code>)
123123
</p>
124124
<p>
125125
Run tests a single time.

packages/@angular/cli/commands/test.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Command = require('../ember-cli/lib/models/command');
22
import TestTask from '../tasks/test';
3-
import {CliConfig} from '../models/config';
3+
import { CliConfig } from '../models/config';
44
import { oneLine } from 'common-tags';
55

66
const config = CliConfig.fromProject() || CliConfig.fromGlobal();
@@ -33,7 +33,6 @@ const TestCommand = Command.extend({
3333
{
3434
name: 'watch',
3535
type: Boolean,
36-
default: true,
3736
aliases: ['w'],
3837
description: 'Run build when files change.'
3938
},
@@ -54,7 +53,6 @@ const TestCommand = Command.extend({
5453
{
5554
name: 'single-run',
5655
type: Boolean,
57-
default: false,
5856
aliases: ['sr'],
5957
description: 'Run tests a single time.'
6058
},
@@ -110,13 +108,13 @@ const TestCommand = Command.extend({
110108
}
111109
],
112110

113-
run: function(commandOptions: TestOptions) {
111+
run: function (commandOptions: TestOptions) {
114112
const testTask = new TestTask({
115113
ui: this.ui,
116114
project: this.project
117115
});
118116

119-
if (!commandOptions.watch) {
117+
if (commandOptions.watch !== undefined && !commandOptions.watch) {
120118
// if not watching ensure karma is doing a single run
121119
commandOptions.singleRun = true;
122120
}

0 commit comments

Comments
 (0)