test: fix resolution to not depend on index.d.ts (#28854)

Implement `readFile` in `MockTypescriptHost` so TypeScript can resolve module based on it's resolution, since certain files are not on disk but in memory

PR Close #28854
This commit is contained in:
Alan Agius 2019-02-25 12:58:13 +01:00 committed by Andrew Kushnir
parent e8bb8f4912
commit 1efad3772e
1 changed files with 2 additions and 0 deletions

View File

@ -152,6 +152,8 @@ export class MockTypescriptHost implements ts.LanguageServiceHost {
fileExists(fileName: string): boolean { return this.getRawFileContent(fileName) != null; }
readFile(path: string): string|undefined { return this.getRawFileContent(path); }
getMarkerLocations(fileName: string): {[name: string]: number}|undefined {
let content = this.getRawFileContent(fileName);
if (content) {