Skip to content

Commit 5b08965

Browse files
committed
feat: add ability to run tests without building
The use case for this scenario is to be able to execute tests while running You have to be inside an angular-cli project in order to use the serve command. This prevents watch/build collisions between the 2 commands
1 parent f609819 commit 5b08965

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

addon/ng2/commands/test.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module.exports = TestCommand.extend({
1616
{ name: 'colors', type: Boolean },
1717
{ name: 'log-level', type: String },
1818
{ name: 'port', type: Number },
19-
{ name: 'reporters', type: String }
19+
{ name: 'reporters', type: String },
20+
{ name: 'build', type: Boolean, default: true }
2021
],
2122

2223
run: function (commandOptions) {
@@ -43,7 +44,17 @@ module.exports = TestCommand.extend({
4344
environment: 'development',
4445
outputPath: 'dist/'
4546
};
46-
47+
48+
// If not building, mock/suppress build tasks.
49+
if (!commandOptions.build) {
50+
buildTask = {
51+
run: () => {
52+
return;
53+
}
54+
};
55+
buildWatchTask = buildTask;
56+
}
57+
4758
if (commandOptions.watch) {
4859
return win.checkWindowsElevation(this.ui)
4960
.then(

0 commit comments

Comments
 (0)