Skip to content

Commit 4c6bfd8

Browse files
committed
Add double quotes to e2e command passed through option
- Remove analytics from spec angular#3688 - Fix sinon types
1 parent 0ae0bba commit 4c6bfd8

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
"@types/node": "^6.0.36",
146146
"@types/request": "0.0.30",
147147
"@types/rimraf": "0.0.25-alpha",
148+
"@types/sinon": "^1.16.33",
148149
"@types/source-map": "^0.5.0",
149150
"@types/webpack": "^1.12.22-alpha",
150151
"chai": "^3.5.0",
@@ -165,7 +166,7 @@
165166
"request": "^2.74.0",
166167
"resolve-bin": "^0.4.0",
167168
"rewire": "^2.5.1",
168-
"sinon": "^1.17.3",
169+
"sinon": "^1.17.6",
169170
"through": "^2.3.8",
170171
"tree-kill": "^1.0.0",
171172
"ts-node": "^1.3.0",

packages/angular-cli/tasks/e2e.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const E2eTask = Task.extend({
1010
let exitCode = 0;
1111

1212
if (options.suite) {
13-
commandArgs.push(`--suite=${options.suite}`);
13+
commandArgs.push(`--suite="${options.suite}"`);
1414
}
1515

1616
return new Promise((resolve) => {

tests/unit/commands/e2e.spec.ts

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import E2eCommand from 'angular-cli/commands/e2e';
22
import { CliConfig } from 'angular-cli/models/config/config';
3-
import { stub } from 'sinon';
3+
import { stub, SinonStub } from 'sinon';
44
import { expect } from 'chai';
55
import * as proc from 'child_process';
66

77
const MockUI = require('../../helpers/mock-ui');
8-
const MockAnalytics = require('../../helpers/mock-analytics');
98
const MockProject = require('../../helpers/mock-project');
109

1110
function createProject() {
@@ -23,26 +22,29 @@ function createProject() {
2322
}
2423

2524
describe('e2e command', () => {
26-
let command: E2eCommand;
25+
let command: any;
26+
let exec: SinonStub;
2727

2828
beforeEach(() => {
2929
command = new E2eCommand({
3030
settings: {},
3131
project: createProject(),
3232
ui: new MockUI(),
33-
analytics: new MockAnalytics(),
3433
});
3534
});
3635

3736
beforeEach(() => {
38-
stub(proc, 'exec').callsArg(1);
37+
exec = stub(proc, 'exec').callsArg(1);
38+
});
39+
40+
afterEach(() => {
41+
exec.restore();
3942
});
4043

4144
it('passes through the suite option', () => {
42-
const commandOption = '--suite=suiteA';
43-
return command.validateAndRun([commandOption]).then(() => {
44-
expect(proc.exec.calledOnce).to.be.true;
45-
expect(proc.exec.firstCall.args[0]).to.have.string(` ${commandOption}`);
45+
return command.validateAndRun(['--suite', 'suiteA,suite B']).then(() => {
46+
expect(exec.calledOnce).to.be.true;
47+
expect(exec.firstCall.args[0]).to.have.string(' --suite="suiteA,suite B"');
4648
});
4749
});
4850
});

0 commit comments

Comments
 (0)