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:
parent
e8bb8f4912
commit
1efad3772e
|
@ -152,6 +152,8 @@ export class MockTypescriptHost implements ts.LanguageServiceHost {
|
||||||
|
|
||||||
fileExists(fileName: string): boolean { return this.getRawFileContent(fileName) != null; }
|
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 {
|
getMarkerLocations(fileName: string): {[name: string]: number}|undefined {
|
||||||
let content = this.getRawFileContent(fileName);
|
let content = this.getRawFileContent(fileName);
|
||||||
if (content) {
|
if (content) {
|
||||||
|
|
Loading…
Reference in New Issue