Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions addon/ng2/commands/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ var win = require('ember-cli/lib/utilities/windows-admin');
var path = require('path');

var BuildTask = require('ember-cli/lib/tasks/build');
var BuildWatchTask = require('../tasks/build-watch');
var BuildWatchTask = require('ember-cli/lib/tasks/build-watch');
var TestTask = require('../tasks/test');


module.exports = TestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: false, aliases: ['w'] },
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
{ name: 'browsers', type: String },
{ name: 'colors', type: Boolean },
{ name: 'log-level', type: String },
Expand All @@ -43,25 +43,23 @@ module.exports = TestCommand.extend({
analytics: this.analytics,
project: this.project
});
commandOptions.singleRun = true;

var buildOptions = {
environment: 'development',
outputPath: 'dist/'
};

if (commandOptions.watch){
return win.checkWindowsElevation(this.ui)
.then(function() {
var buildWatchResult = buildWatchTask.run(buildOptions);

buildWatchResult.watcher.on('change', function(){
testTask.run(commandOptions);
});

return buildWatchResult.completion;
return Promise.all([
buildWatchTask.run(buildOptions),
testTask.run(commandOptions)
]);
});
} else {
// if not watching ensure karma is doing a single run
commandOptions.singleRun = true;
return win.checkWindowsElevation(this.ui)
.then(function() {
return buildTask.run(buildOptions);
Expand Down
39 changes: 0 additions & 39 deletions addon/ng2/tasks/build-watch.js

This file was deleted.

3 changes: 2 additions & 1 deletion tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ describe('Basic end-to-end Workflow', function () {

var testArgs = [
'test',
'--single-run'
'--watch',
'false'
];

// In travis CI only run tests in Chrome_travis_ci
Expand Down