Merge pull request #1190 from Microsoft/unbreakHarness
Fail on tests with errors and reinstate noResolve in fourslash tests
This commit is contained in:
commit
6c631a6ae4
|
@ -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,
|
||||
|
|
|
@ -8,4 +8,4 @@ test.markers().forEach(marker => {
|
|||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListItemsCountIsGreaterThan(0)
|
||||
}}
|
||||
});
|
|
@ -8,4 +8,4 @@ test.markers().forEach(marker => {
|
|||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListIsEmpty()
|
||||
}
|
||||
});
|
|
@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => {
|
|||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
|
@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => {
|
|||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
|
@ -51,4 +51,4 @@ for (var i = 1; i <= test.markers().length; i++) {
|
|||
verify.occurrencesAtPositionCount(1); // 'return' is an instance member
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue