test(ivy): ngcc - fix tests to work on Windows (#30520)

PR Close #30520
This commit is contained in:
Pete Bacon Darwin 2019-05-16 20:30:03 +01:00 committed by Jason Aden
parent 757d4c33df
commit 73e3f565e0
2 changed files with 12 additions and 12 deletions

View File

@ -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', () => {
@ -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(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/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(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 {

View File

@ -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', () => {