Skip to content

Commit

Permalink
Added tests for the optional/impliciet version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rspieker committed Oct 19, 2015
1 parent e98abb1 commit 6468af0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,28 @@ lab.experiment('Wanted - Unknown', function() {
});
});

lab.experiment('Install version specific requirements', function() {
lab.test('Require an unknown module', {timeout: 15000}, function(done) {
var wanted = new Wanted(),
blame = wanted.require('blame');

// we expect the blame module to exist and be the (version agnostic) module we wanted
Code.expect('stack' in blame).to.equal(true);
Code.expect(typeof blame.stack).to.equal('function');

done();
});

lab.test('Require the (implicit) latest version', {timeout: 15000}, function(done) {
var wanted = new Wanted(),
blame = wanted.require('blame', true);

// we expect the blame module to exist and be the (version agnostic) module we wanted
Code.expect('stack' in blame).to.equal(true);
Code.expect(typeof blame.stack).to.equal('function');

done();
});
});

});

0 comments on commit 6468af0

Please sign in to comment.