Skip to content

Commit

Permalink
Coverage for #1769
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Jul 5, 2014
1 parent 98cf1d7 commit e3c044f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,22 @@ describe('Pack', function () {
});
});

it('errors on invalid plugin', function (done) {

var manifest = {
servers: [{}],
plugins: {
'../test/pack/--fail': null
}
};

Hapi.Pack.compose(manifest, function (err, pack) {

expect(err).to.exist;
done();
});
});

it('throws on pack with missing inner deps', function (done) {

var manifest = {
Expand Down
16 changes: 16 additions & 0 deletions test/pack/--fail/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Declare internals

var internals = {};


// Plugin registration

exports.register = function (plugin, options, next) {

return next(new Error('failed'));
};

exports.register.attributes = {
name: '--fail',
version: '1.0.0'
};
7 changes: 7 additions & 0 deletions test/pack/--fail/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "--fail",
"description": "Test plugin module",
"version": "0.0.1",
"private": true,
"main": "lib/index"
}

0 comments on commit e3c044f

Please sign in to comment.