Skip to content
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
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var fs = require('fs'),
resolve = require('path').resolve,
dirname = require('path').dirname,
defaultOptions = {
extensions: ['js', 'json', 'coffee'],
extensions: ['js', 'json', 'coffee', 'ts'],
recurse: true,
rename: function (name) {
return name;
Expand Down
1 change: 1 addition & 0 deletions test/example/foo3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'foo3!';
9 changes: 9 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
assert.equal('be', test.bun.should);
});

test('should work with TS', function () {
//act
var test = reqdir(module, PATH_TO_EXAMPLE);

//assert
assert.equal('foo!', test.foo);
assert.equal('foo3!', test.foo3);
});

test('should be able to specify supported extensions', function () {
//act
var test = reqdir(module, PATH_TO_EXAMPLE, {extensions: ['json']});
Expand Down