Skip to content

Commit

Permalink
test(resolve): resolveModule with custom paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Jul 4, 2018
1 parent 914de3b commit 5b19604
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/jest-resolve/src/__tests__/resolve.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ describe('resolveModule', () => {
require.resolve('../../src/__mocks__/foo/node_modules/dep/index.js'),
);
});

it('is possible to specify custom resolve paths', () => {
const resolver = new Resolver(moduleMap, {
extensions: ['.js'],
});
const src = require.resolve('../');
const resolved = resolver.resolveModule(src, 'mockJsDependency', {
paths: [
path.resolve(__dirname, '../../src/__tests__'),
path.resolve(__dirname, '../../src/__mocks__'),
],
});
expect(resolved).toBe(require.resolve('../__mocks__/mockJsDependency.js'));
});
});

describe('getMockModule', () => {
Expand Down

0 comments on commit 5b19604

Please sign in to comment.