Skip to content

Commit

Permalink
Merge pull request #7 from mroderick/add-require-alias
Browse files Browse the repository at this point in the history
Add `require` as alias for `requireWithStubs`
  • Loading branch information
codazzo committed Jun 23, 2015
2 parents 9131477 + 6eb33c4 commit a56a04d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ define([
bogus.stub('SteeringWheel', fakeSteeringWheel);

// load Car module, that depends on SteeringWheel
bogus.requireWithStubs('Car', function(module){
bogus.require('Car', function(module){
Car = module;
done();
});
Expand Down
1 change: 1 addition & 0 deletions bogus.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ define(['require'], function(require){

return {
stub: stubOneOrMany,
require: requireWithStubs,
requireWithStubs: requireWithStubs,
reset: reset
};
Expand Down
6 changes: 6 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
});
});

describe('require method', function(){
it('should be an alias of requireWithStubs', function(){
assert.equal(bogus.require, bogus.requireWithStubs);
});
});

describe('reset method', function(){
it('should return all original implementations to their names', function(done){
var define = requirejs.define,
Expand Down

0 comments on commit a56a04d

Please sign in to comment.