mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fail on tests with errors; reinstated noResolve; corrected tests that were not actually compiling.
This commit is contained in:
@@ -2241,11 +2241,12 @@ module FourSlash {
|
||||
(fn, contents) => result = contents,
|
||||
ts.ScriptTarget.Latest,
|
||||
sys.useCaseSensitiveFileNames);
|
||||
var program = ts.createProgram([Harness.Compiler.fourslashFilename, fileName], { out: "fourslashTestOutput.js" }, host);
|
||||
// TODO (drosen): We need to enforce checking on these tests.
|
||||
var program = ts.createProgram([Harness.Compiler.fourslashFilename, fileName], { out: "fourslashTestOutput.js", noResolve: true }, host);
|
||||
var checker = ts.createTypeChecker(program, /*fullTypeCheckMode*/ true);
|
||||
checker.checkProgram();
|
||||
|
||||
var errs = checker.getDiagnostics(program.getSourceFile(fileName));
|
||||
var errs = program.getDiagnostics().concat(checker.getDiagnostics());
|
||||
if (errs.length > 0) {
|
||||
throw new Error('Error compiling ' + fileName + ': ' + errs.map(e => e.messageText).join('\r\n'));
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ module Harness {
|
||||
return defaultLibSourceFile;
|
||||
}
|
||||
// Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
getDefaultLibFilename: () => defaultLibFileName,
|
||||
|
||||
Reference in New Issue
Block a user