Skip to content

Commit

Permalink
cli: spawn Cypress with option --run-from-cli, close #1573
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Apr 13, 2018
1 parent 3917545 commit e9bac25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ module.exports = {
debug('needs XVFB?', needsXvfb)

// always push cwd into the args
args = [].concat(args, '--cwd', process.cwd())
// also pass a flag to let binary know it was not executed
// directly by the user, but through this NPM module
args = [].concat(args, '--run-from-cli', '--cwd', process.cwd())

_.defaults(options, {
detached: false,
Expand Down
2 changes: 2 additions & 0 deletions cli/test/lib/exec/spawn_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('exec spawn', function () {
.then(() => {
expect(cp.spawn).to.be.calledWithMatch('/path/to/cypress', [
'--foo',
'--run-from-cli',
'--cwd',
cwd,
], {
Expand All @@ -62,6 +63,7 @@ describe('exec spawn', function () {
expect(cp.spawn).to.be.calledWithMatch('node', [
p,
'--foo',
'--run-from-cli',
'--cwd',
cwd,
], {
Expand Down

0 comments on commit e9bac25

Please sign in to comment.