fix(tsc-wrapped): ensure valid path separators in metadata
* Fixes that `tsc-wrapped` stores invalid path separators in the bundled metadata files. Previous errors could have been: `Cannot find module '.corecoordinationnique-selection-dispatcher'.` (See https://github.com/angular/material2/issues/3834) * Fixes failing tests on Windows. Now all tooling tests are green on Windows. Related to #15403
This commit is contained in:
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
@ -84,6 +83,19 @@ describe('metadata bundler', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('should not output windows paths in metadata', () => {
|
||||
const host = new MockStringBundlerHost('/', {
|
||||
'index.ts': `
|
||||
export * from './exports/test';
|
||||
`,
|
||||
'exports': {'test.ts': `export class TestExport {}`}
|
||||
});
|
||||
const bundler = new MetadataBundler('/index', undefined, host);
|
||||
const result = bundler.getMetadataBundle();
|
||||
|
||||
expect(result.metadata.origins).toEqual({'TestExport': './exports/test'});
|
||||
});
|
||||
|
||||
it('should convert re-exported to the export', () => {
|
||||
const host = new MockStringBundlerHost('/', {
|
||||
'index.ts': `
|
||||
|
Reference in New Issue
Block a user