diff --git a/__tests__/lib/module_filters.js b/__tests__/lib/module_filters.js new file mode 100644 index 000000000..82309cf08 --- /dev/null +++ b/__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); +}); diff --git a/src/module_filters.js b/src/module_filters.js index ab30d06b7..bf5bd796b 100644 --- a/src/module_filters.js +++ b/src/module_filters.js @@ -23,7 +23,7 @@ module.exports = { * @param {Array} 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.