Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch the package managers name printed out when yarn.lock file is p…
…resent
- Loading branch information
Sam De Maeyer
committed
Mar 20, 2017
1 parent
ccd0125
commit 7a6ca3b
Showing
6 changed files
with
123 additions
and
2 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
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,5 @@ | ||
{ | ||
"name": "project-npm-check", | ||
"dependencies": { | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/project-yarn-check/node_modules/ember-cli/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
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,103 @@ | ||
'use strict'; | ||
|
||
var assertError = require('../helpers/assert-error'); | ||
var assertNoError = require('../helpers/assert-no-error'); | ||
var DependencyChecker = require('../../lib/dependency-checker'); | ||
var projectBuilder = require('../helpers/project-builder'); | ||
|
||
describe('EmberCLIDependencyChecker', function() { | ||
beforeEach(function(){ | ||
DependencyChecker.setAlreadyChecked(false); | ||
}); | ||
|
||
function createProject(dependencies, options) { | ||
options = options || {}; | ||
options.root = options.root || 'tests/fixtures/project-yarn-check'; | ||
options.dependencies = projectBuilder.buildDependencies(dependencies); | ||
return projectBuilder.build(options); | ||
} | ||
|
||
var assertNpmError = function(project) { | ||
return assertError(project, 'yarn'); | ||
}; | ||
|
||
var assertNoNpmError = function(project) { | ||
return assertNoError(project, 'yarn'); | ||
}; | ||
|
||
describe('reports unsatisfied NPM dependencies', function() { | ||
it('when the specified package is not installed', function() { | ||
var project = createProject({ 'foo': '0.1.1', 'ember-cli': '1.2.3' }); | ||
assertNpmError(project); | ||
}); | ||
|
||
it('when the installed package does not match the version specified', function() { | ||
var project = createProject({ 'ember-cli': '0.1.1' }); | ||
assertNpmError(project); | ||
}); | ||
|
||
it('when the installed package does not satisfy the version range specified', function() { | ||
var project = createProject({ 'ember-cli': '>1.3.2 <=2.3.4' }); | ||
assertNpmError(project); | ||
}); | ||
|
||
it('when the installed package is not compatible with the version specified', function() { | ||
var project = createProject({ 'ember-cli': '0.2.x' }); | ||
assertNpmError(project); | ||
}); | ||
|
||
it('when the version specified is a Git repo with a semver tag and there is a version mismatch', function() { | ||
var project = createProject({ 'ember-cli': 'git://github.com/stefanpenner/ember-cli.git#v0.1.0' }); | ||
assertNpmError(project); | ||
}); | ||
}); | ||
|
||
describe('does not report satisfied NPM dependencies', function() { | ||
it('when the installed package matches the version specified', function() { | ||
var project = createProject({ 'ember-cli': '1.2.3' }); | ||
assertNoNpmError(project); | ||
}); | ||
|
||
it('when the installed package satisfies the version range specified', function() { | ||
var project = createProject({ 'ember-cli': '>1.0.0' }); | ||
assertNoNpmError(project); | ||
}); | ||
|
||
it('when the installed package is compatible with the version specified', function() { | ||
var project = createProject({ 'ember-cli': '^1.2.0' }); | ||
assertNoNpmError(project); | ||
}); | ||
|
||
it('when the version specified is a URL', function() { | ||
var project = createProject({ 'ember-cli': 'http://ember-cli.com/ember-cli.tar.gz' }); | ||
assertNoNpmError(project); | ||
}); | ||
|
||
it('when the version specified is a Git repo with a non-semver tag', function() { | ||
var project = createProject({ 'ember-cli': 'git://github.com/stefanpenner/ember-cli.git#master' }); | ||
assertNoNpmError(project); | ||
}); | ||
|
||
it('when the version specified is a local path', function() { | ||
var project = createProject({ 'ember-cli': '~/projects/ember-cli' }); | ||
assertNoNpmError(project); | ||
}); | ||
|
||
it('does NOT error with a * dependency', function() { | ||
var project = createProject({ 'ember-cli': '*' }); | ||
assertNoNpmError(project); | ||
}); | ||
}); | ||
|
||
describe('sibling node_modules/ directory', function() { | ||
it('checks depdencies', function() { | ||
var project = createProject({ | ||
'ember-cli': '*' | ||
}, { | ||
root: 'tests/fixtures/project-npm-sibling-node-modules-check/app', | ||
nodeModulesPath: 'tests/fixtures/project-npm-sibling-node-modules-check/node_modules', | ||
}); | ||
assertNoNpmError(project); | ||
}); | ||
}); | ||
}); |