Skip to content

Commit 3598b90

Browse files
committed
Add optional argument to readConfigFile
Which allows the caller to specify the `System` used to read the file.
1 parent c9c6d82 commit 3598b90

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ namespace ts {
374374
* Read tsconfig.json file
375375
* @param fileName The path to the config file
376376
*/
377-
export function readConfigFile(fileName: string): { config?: any; error?: Diagnostic } {
377+
export function readConfigFile(fileName: string, system: System = sys): { config?: any; error?: Diagnostic } {
378378
let text = "";
379379
try {
380-
text = sys.readFile(fileName);
380+
text = system.readFile(fileName);
381381
}
382382
catch (e) {
383383
return { error: createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };

0 commit comments

Comments
 (0)