Skip to content

Commit

Permalink
test: Add tests for moduleFilters, tiny typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Sep 14, 2017
1 parent d731ce8 commit 8fc07da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions __tests__/lib/module_filters.js
@@ -0,0 +1,13 @@
var moduleFilters = require('../../src/module_filters');

test('moduleFilters.internalOnly', function() {
expect(moduleFilters.internalOnly('./foo')).toEqual(true);
expect(moduleFilters.internalOnly('foo')).toEqual(false);
});

test('moduleFilters.externals', function() {
expect(moduleFilters.externals([], {})('./foo')).toEqual(true);
expect(
moduleFilters.externals([], { external: 'node_modules' })('./foo')
).toEqual(true);
});
2 changes: 1 addition & 1 deletion src/module_filters.js
Expand Up @@ -23,7 +23,7 @@ module.exports = {
* @param {Array<string>} indexes - the list of entry points that will be
* used by module-deps
* @param {Object} options - An options object with `external` being a
* micromatch-compaitible glob. *NOTE:* the glob will be matched relative to
* micromatch-compatible glob. *NOTE:* the glob will be matched relative to
* the top-level node_modules directory for each entry point.
* @returns {function} - A function for use as the module-deps `postFilter`
* options.
Expand Down

0 comments on commit 8fc07da

Please sign in to comment.