Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('DependencyResolver', () => {
resolver = new DependencyResolver(new MockLogger(), {esm2015: host});
expect(() => resolver.sortEntryPointsByDependency([first]))
.toThrowError(
`Could not find a suitable format for computing dependencies of entry-point: '/first'.`);
`Could not find a suitable format for computing dependencies of entry-point: '${first.path}'.`);
});

it('should capture any dependencies that were ignored', () => {
Expand Down Expand Up @@ -159,17 +159,17 @@ describe('DependencyResolver', () => {
const result = resolver.sortEntryPointsByDependency([fifth, first, fourth, second, third]);
expect(result.entryPoints).toEqual([fifth, fourth, third, second, first]);

expect(esm5Host.findDependencies).toHaveBeenCalledWith('/first/index.js');
expect(esm5Host.findDependencies).not.toHaveBeenCalledWith('/second/sub/index.js');
expect(esm5Host.findDependencies).toHaveBeenCalledWith('/third/index.js');
expect(esm5Host.findDependencies).not.toHaveBeenCalledWith('/fourth/sub2/index.js');
expect(esm5Host.findDependencies).toHaveBeenCalledWith('/fifth/index.js');

expect(esm2015Host.findDependencies).not.toHaveBeenCalledWith('/first/index.js');
expect(esm2015Host.findDependencies).toHaveBeenCalledWith('/second/sub/index.js');
expect(esm2015Host.findDependencies).not.toHaveBeenCalledWith('/third/index.js');
expect(esm2015Host.findDependencies).toHaveBeenCalledWith('/fourth/sub2/index.js');
expect(esm2015Host.findDependencies).not.toHaveBeenCalledWith('/fifth/index.js');
expect(esm5Host.findDependencies).toHaveBeenCalledWith(`${first.path}/index.js`);
expect(esm5Host.findDependencies).not.toHaveBeenCalledWith(`${second.path}/sub/index.js`);
expect(esm5Host.findDependencies).toHaveBeenCalledWith(`${third.path}/index.js`);
expect(esm5Host.findDependencies).not.toHaveBeenCalledWith(`${fourth.path}/sub2/index.js`);
expect(esm5Host.findDependencies).toHaveBeenCalledWith(`${fifth.path}/index.js`);

expect(esm2015Host.findDependencies).not.toHaveBeenCalledWith(`${first.path}/index.js`);
expect(esm2015Host.findDependencies).toHaveBeenCalledWith(`${second.path}/sub/index.js`);
expect(esm2015Host.findDependencies).not.toHaveBeenCalledWith(`${third.path}/index.js`);
expect(esm2015Host.findDependencies).toHaveBeenCalledWith(`${fourth.path}/sub2/index.js`);
expect(esm2015Host.findDependencies).not.toHaveBeenCalledWith(`${fifth.path}/index.js`);
});

interface DepMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('UmdDependencyHost', () => {
expect(dependencies.size).toBe(0);
expect(missing.size).toBe(0);
expect(deepImports.size).toBe(1);
expect(deepImports.has('/node_modules/lib_1/deep/import')).toBe(true);
expect(deepImports.has(_('/node_modules/lib_1/deep/import'))).toBe(true);
});

it('should recurse into internal dependencies', () => {
Expand Down