-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tests): add '--suite' option to 'ng e2e' command #3551
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d298d3a
Add '--suite' option to 'ng e2e' command
jupapios 0ae0bba
Merge branch 'master' into e2e-suite-option
Gotik 4c6bfd8
Add double quotes to e2e command passed through option
jupapios 3729d1d
Merge branch 'master' into e2e-suite-option
Gotik 19f4d87
Merge branch 'master' into e2e-suite-option
Gotik d90f6d7
Merge branch 'master' into e2e-suite-option
Gotik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'use strict'; | ||
|
||
var Project = require('angular-cli/ember-cli/lib/models/project'); | ||
var MockUI = require('./mock-ui'); | ||
|
||
function MockProject() { | ||
var root = process.cwd(); | ||
var pkg = {}; | ||
var ui = new MockUI(); | ||
Project.apply(this, [root, pkg, ui]); | ||
} | ||
|
||
MockProject.prototype.require = function(file) { | ||
if (file === './server') { | ||
return function() { | ||
return { | ||
listen: function() { | ||
arguments[arguments.length - 1](); | ||
} | ||
}; | ||
}; | ||
} | ||
}; | ||
|
||
MockProject.prototype.config = function() { | ||
return this._config || { | ||
baseURL: '/', | ||
locationType: 'auto' | ||
}; | ||
}; | ||
|
||
MockProject.prototype.has = function(key) { | ||
return (/server/.test(key)); | ||
}; | ||
|
||
MockProject.prototype.name = function() { | ||
return 'mock-project'; | ||
}; | ||
|
||
MockProject.prototype.initializeAddons = Project.prototype.initializeAddons; | ||
MockProject.prototype.hasDependencies = function() { | ||
return true; | ||
}; | ||
MockProject.prototype.discoverAddons = Project.prototype.discoverAddons; | ||
MockProject.prototype.addIfAddon = Project.prototype.addIfAddon; | ||
MockProject.prototype.supportedInternalAddonPaths = Project.prototype.supportedInternalAddonPaths; | ||
MockProject.prototype.setupBowerDirectory = Project.prototype.setupBowerDirectory; | ||
MockProject.prototype.setupNodeModulesPath = Project.prototype.setupNodeModulesPath; | ||
MockProject.prototype.isEmberCLIProject = Project.prototype.isEmberCLIProject; | ||
MockProject.prototype.isEmberCLIAddon = Project.prototype.isEmberCLIAddon; | ||
MockProject.prototype.findAddonByName = Project.prototype.findAddonByName; | ||
MockProject.prototype.dependencies = function() { | ||
return []; | ||
}; | ||
MockProject.prototype.isEmberCLIAddon = function() { | ||
return false; | ||
}; | ||
|
||
module.exports = MockProject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import E2eCommand from 'angular-cli/commands/e2e'; | ||
import { CliConfig } from 'angular-cli/models/config/config'; | ||
import { stub } from 'sinon'; | ||
import { expect } from 'chai'; | ||
import * as proc from 'child_process'; | ||
|
||
const MockUI = require('../../helpers/mock-ui'); | ||
const MockAnalytics = require('../../helpers/mock-analytics'); | ||
const MockProject = require('../../helpers/mock-project'); | ||
|
||
function createProject() { | ||
const project = new MockProject(); | ||
project.isEmberCLIProject = () => true; | ||
project.ngConfig = CliConfig.fromJson({ | ||
e2e: { | ||
protractor: { | ||
config: 'some-config' | ||
} | ||
} | ||
}); | ||
|
||
return project; | ||
} | ||
|
||
describe('e2e command', () => { | ||
let command: E2eCommand; | ||
|
||
beforeEach(() => { | ||
command = new E2eCommand({ | ||
settings: {}, | ||
project: createProject(), | ||
ui: new MockUI(), | ||
analytics: new MockAnalytics(), | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
stub(proc, 'exec').callsArg(1); | ||
}); | ||
|
||
it('passes through the suite option', () => { | ||
const commandOption = '--suite=suiteA'; | ||
return command.validateAndRun([commandOption]).then(() => { | ||
expect(proc.exec.calledOnce).to.be.true; | ||
expect(proc.exec.firstCall.args[0]).to.have.string(` ${commandOption}`); | ||
}); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're feeding in concatenated strings from the input, which would remove quotes etc. Could you surround the argument with double quotes?