feat: add .ngsummary.ts files to support AOT unit tests
Design doc: https://docs.google.com/document/d/1VmTkz0EbEVSWfEEWEvQ5sXyQXSCvtMOw4t7pKU-jOwc/edit?usp=sharing
This commit is contained in:

committed by
Matias Niemelä

parent
2714644528
commit
547c363473
@ -372,7 +372,7 @@ export class MockSummaryResolver implements SummaryResolver<StaticSymbol> {
|
||||
symbol: StaticSymbol,
|
||||
importAs: StaticSymbol
|
||||
}[] = []) {}
|
||||
|
||||
addSummary(summary: Summary<StaticSymbol>) { this.summaries.push(summary); };
|
||||
resolveSummary(reference: StaticSymbol): Summary<StaticSymbol> {
|
||||
return this.summaries.find(summary => summary.symbol === reference);
|
||||
};
|
||||
@ -442,6 +442,10 @@ export class MockStaticSymbolResolverHost implements StaticSymbolResolverHost {
|
||||
return '/tmp/' + modulePath + '.d.ts';
|
||||
}
|
||||
|
||||
fileNameToModuleName(filePath: string, containingFile: string) {
|
||||
return filePath.replace(/(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/, '');
|
||||
}
|
||||
|
||||
getMetadataFor(moduleId: string): any { return this._getMetadataFor(moduleId); }
|
||||
|
||||
private _getMetadataFor(filePath: string): any {
|
||||
|
Reference in New Issue
Block a user