Skip to content
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

✨ Error out on partial bower packages #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/dependency-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ EmberCLIDependencyChecker.prototype.readDependencies = function(dependencies, ty
} else {
var versionInstalled = this.lookupBowerPackageVersion(name);
var path = buildBowerPackagePath(this.project, name);
return new Package(name, versionSpecified, versionInstalled, path);
try {
return new Package(name, versionSpecified, versionInstalled, path);
} catch (error) {
var DependencyError = require('./dependency-error');
throw new DependencyError(`Missing bower packages?\nError mapping package ${path} (version specified: ${versionSpecified}, installed: ${versionInstalled})`);
}
}
}, this);
};
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/dependency-checker-bower-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ describe('EmberCLIDependencyChecker', function() {
var project = createProject({ 'ember-easyForm': 'http://builds.dockyard.com.s3.amazonaws.com/ember-easyForm/canary/ember-easyForm.js' });
assertBowerError(project);
});

it('when the version specified is a URL and installed package does not include bower.json and version key in .bower.json', function() {
var project = createProject({ 'sinon': '1.2.1' });
assertBowerError(project);
});
});

describe('does not report satisfied Bower dependencies', function() {
Expand Down