Fix getDefaultLibraryFile + turn off lib

1. getDefaultLibraryFile should use ts to normalise the file and find
the filename.
2. lib should be turned off at the same time that noLib is turned on to
avoid a pointless error.
This commit is contained in:
Nathan Shively-Sanders 2017-11-07 16:08:57 -08:00
parent ad18bde92b
commit 4e4f7507d0
2 changed files with 3 additions and 2 deletions

View file

@ -2146,8 +2146,8 @@ namespace Harness {
return filePath.indexOf(Harness.libFolder) === 0;
}
export function getDefaultLibraryFile(libPath: string, io: Harness.Io): Harness.Compiler.TestFile {
const libFile = Harness.userSpecifiedRoot + Harness.libFolder + libPath.slice(io.directoryName(libPath).length + 1);
export function getDefaultLibraryFile(filePath: string, io: Harness.Io): Harness.Compiler.TestFile {
const libFile = Harness.userSpecifiedRoot + Harness.libFolder + ts.getBaseFileName(ts.normalizeSlashes(filePath));
return { unitName: libFile, content: io.readFile(libFile) };
}

View file

@ -138,6 +138,7 @@ namespace RWC {
}
// do not use lib since we already read it in above
opts.options.lib = undefined;
opts.options.noLib = true;
// Emit the results