Skip to content

Commit 60bd06d

Browse files
committed
Support tsconfig.json in tests
1 parent 74a961b commit 60bd06d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/harness/harness.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ namespace Harness {
839839
const sourceFile = createSourceFileAndAssertInvariants(fileName, file.content, scriptTarget);
840840
const path = ts.toPath(file.unitName, currentDirectory, getCanonicalFileName);
841841
fileMap.set(path, sourceFile);
842+
fileMap.set(<ts.Path>fileName, sourceFile);
842843
}
843844
}
844845

@@ -875,8 +876,8 @@ namespace Harness {
875876
getCanonicalFileName,
876877
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
877878
getNewLine: () => newLine,
878-
fileExists: fileName => getSourceFile(fileName, ts.ScriptTarget.ES5) !== undefined,
879-
readFile: (fileName: string): string => { throw new Error("NotYetImplemented"); }
879+
fileExists: fileName => fileMap.contains(<ts.Path>ts.normalizePath(fileName)),
880+
readFile: (fileName: string): string => fileMap.get(<ts.Path>ts.normalizePath(fileName)).getText()
880881
};
881882
}
882883

0 commit comments

Comments
 (0)