Skip to content
Permalink
Browse files

fix(bazel): correct regexp test for self-references in metadata (#29346)

Add a test that catches the mistake, should have had this in the previous change

PR Close #29346
  • Loading branch information...
alexeagle authored and jasonaden committed Mar 15, 2019
1 parent 3d5b986 commit 9d090cb3db3a972593530a1de749809029100290
@@ -415,7 +415,7 @@ export * from '${srcDirRelative(inputPath, typingsFile.replace(/\.d\.tsx?$/, '')
if (metadata.exports) {
// Strip re-exports which are now self-references
metadata.exports =
metadata.exports.filter((e: {from: string}) => !relativePathRegex.test(e.from));
metadata.exports.filter((e: {from: string}) => !e.from.match(relativePathRegex));
}
return JSON.stringify(metadata).replace(relativePathRegex, typingsRelativePath);
}
@@ -89,6 +89,8 @@ describe('@angular/core ng_package', () => {
.describe('angular metadata', () => {
it('should have metadata.json files',
() => { expect(shx.cat('core.metadata.json')).toContain(`"__symbolic":"module"`); });
it('should not have self-references in metadata.json',
() => { expect(shx.cat('core.metadata.json')).not.toContain(`"from":"./core"`); });
});

describe('fesm2015', () => {

0 comments on commit 9d090cb

Please sign in to comment.
You can’t perform that action at this time.