Skip to content

Commit 7b26538

Browse files
committed
chore(e2e): remove npm err output from e2e (#594)
1 parent a65c72c commit 7b26538

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

addon/ng2/commands/e2e.js renamed to addon/ng2/commands/e2e.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
/* jshint node: true */
2-
'use strict';
3-
4-
var Command = require('ember-cli/lib/models/command');
5-
const config = require('../models/config');
6-
var E2ETask = require('../tasks/e2e');
1+
import * as Command from 'ember-cli/lib/models/command';
2+
import * as E2ETask from '../tasks/e2e';
3+
import {CliConfig} from '../models/config';
74

85
module.exports = Command.extend({
96
name: 'e2e',
107
description: 'Run e2e tests in existing project',
118
works: 'insideProject',
129
run: function () {
13-
this.project.ngConfig = this.project.ngConfig || config.CliConfig.fromProject();
10+
this.project.ngConfig = this.project.ngConfig || CliConfig.fromProject();
1411

1512
var e2eTask = new E2ETask({
1613
ui: this.ui,

addon/ng2/tasks/e2e.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

addon/ng2/tasks/e2e.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as Promise from 'ember-cli/lib/ext/promise';
2+
import * as Task from 'ember-cli/lib/models/task';
3+
import * as chalk from 'chalk';
4+
import {exec} from 'child_process';
5+
6+
module.exports = Task.extend({
7+
run: function () {
8+
var ui = this.ui;
9+
10+
return new Promise((resolve) => {
11+
exec(`npm run e2e -- ${this.project.ngConfig.e2e.protractor.config}`, (err, stdout) => {
12+
ui.writeLine(stdout);
13+
if (err) {
14+
ui.writeLine(chalk.red('Some end-to-end tests failed, see above.'));
15+
} else {
16+
ui.writeLine(chalk.green('All end-to-end tests pass.'));
17+
}
18+
resolve();
19+
});
20+
});
21+
}
22+
});

0 commit comments

Comments
 (0)