-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from gnclmorais/master
Skip dependency check on `ember init`
- Loading branch information
Showing
6 changed files
with
169 additions
and
9 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
language: node_js | ||
node_js: | ||
- "6" | ||
- "8" | ||
- "10" | ||
|
||
|
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
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,57 @@ | ||
/* eslint-env node, mocha */ | ||
const assert = require('chai').assert; | ||
const sinon = require('sinon'); | ||
const index = require('../../index'); | ||
const DependencyChecker = require('../../lib/dependency-checker'); | ||
|
||
// Simple stubbing of some basic inner workings of the module | ||
const indexStub = { | ||
_super: { init: () => {} }, | ||
...index, | ||
} | ||
|
||
describe('index', function () { | ||
let argv; | ||
|
||
beforeEach(function() { | ||
// Keep a reference to the original arguments, | ||
// since we're going to fiddle with them. | ||
argv = process.argv; | ||
}); | ||
|
||
afterEach(function() { | ||
// Restore the original arguments and any changes made through sinon. | ||
process.argv = argv; | ||
sinon.restore(); | ||
}); | ||
|
||
describe('command passed to ember is init', function () { | ||
it('does not check dependencies', function () { | ||
// Arrange | ||
const dependenciesChecked = sinon.stub(DependencyChecker.prototype, 'checkDependencies'); | ||
const extraArgs = ['/path/to/ember', 'init', 'something-else']; | ||
process.argv = [...process.argv, ...extraArgs]; | ||
|
||
// Act | ||
indexStub.init(); | ||
|
||
// Assert | ||
assert.isFalse(dependenciesChecked.called, 'Dependencies have not been checked'); | ||
}); | ||
}); | ||
|
||
describe('command passed to ember is not init', function () { | ||
it('checks dependencies', function () { | ||
// Arrange | ||
const dependenciesChecked = sinon.stub(DependencyChecker.prototype, 'checkDependencies'); | ||
const extraArgs = ['/path/to/ember', 'link', 'something-else']; | ||
process.argv = [...process.argv, ...extraArgs]; | ||
|
||
// Act | ||
indexStub.init(); | ||
|
||
// Assert | ||
assert.isTrue(dependenciesChecked.called, 'Dependencies have not been checked'); | ||
}); | ||
}); | ||
}); |
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