Skip to content

Commit eef907a

Browse files
committed
Merge pull request #7524 from Microsoft/rwcRunnerFixes
RWC runner fixes for reading json files
2 parents 2899e97 + 821723b commit eef907a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/harness/harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ namespace Harness {
876876
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
877877
getNewLine: () => newLine,
878878
fileExists: fileName => getSourceFile(fileName, ts.ScriptTarget.ES5) !== undefined,
879-
readFile: (fileName: string): string => { throw new Error("NotYetImplemented"); }
879+
readFile: (fileName: string): string => { return Harness.IO.readFile(fileName); }
880880
};
881881
}
882882

src/harness/rwcRunner.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,20 @@ namespace RWC {
3131
let otherFiles: Harness.Compiler.TestFile[] = [];
3232
let compilerResult: Harness.Compiler.CompilerResult;
3333
let compilerOptions: ts.CompilerOptions;
34-
let baselineOpts: Harness.Baseline.BaselineOptions = {
34+
const baselineOpts: Harness.Baseline.BaselineOptions = {
3535
Subfolder: "rwc",
3636
Baselinefolder: "internal/baselines"
3737
};
38-
let baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2];
38+
const baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2];
3939
let currentDirectory: string;
4040
let useCustomLibraryFile: boolean;
4141
after(() => {
4242
// Mocha holds onto the closure environment of the describe callback even after the test is done.
4343
// Therefore we have to clean out large objects after the test is done.
44-
inputFiles = undefined;
45-
otherFiles = undefined;
44+
inputFiles = [];
45+
otherFiles = [];
4646
compilerResult = undefined;
4747
compilerOptions = undefined;
48-
baselineOpts = undefined;
49-
baseName = undefined;
5048
currentDirectory = undefined;
5149
// useCustomLibraryFile is a flag specified in the json object to indicate whether to use built/local/lib.d.ts
5250
// or to use lib.d.ts inside the json object. If the flag is true, use the lib.d.ts inside json file

0 commit comments

Comments
 (0)