Created
August 28, 2015 00:13
-
-
Save francisbrito/68aa395853860df39da9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
'use strict'; | |
module.exports = function bar() { | |
return 'bar works'; | |
}; |
This file contains hidden or 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
'use strict'; | |
module.exports = function baz() { | |
return 'baz works'; | |
}; |
This file contains hidden or 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
'use strict'; | |
module.exports = function foo() { | |
return 'foo works'; | |
}; |
This file contains hidden or 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
/* global describe, it */ | |
'use strict'; | |
var expect = require('chai').expect; | |
var loaddir = require('./'); | |
describe('loaddir', function () { | |
it('should return an object with file names as keys and `require`-d modules as values from `path`.', function () { | |
var path = './mocks'; | |
var sut = loaddir(path); | |
expect(sut).to.be.ok; | |
expect(sut).to.have.keys('foo', 'bar', 'baz'); | |
expect(sut.foo()).to.equal('foo works'); | |
expect(sut.bar()).to.equal('bar works'); | |
expect(sut.baz()).to.equal('baz works'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment