We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eac7a48 commit 40f0c60Copy full SHA for 40f0c60
src/harness/fourslash.ts
@@ -2263,7 +2263,11 @@ namespace FourSlash {
2263
// Parse out the files and their metadata
2264
const testData = parseTestData(basePath, content, fileName);
2265
const state = new TestState(basePath, testType, testData);
2266
- runCode(ts.transpile(content), state);
+ const output = ts.transpileModule(content, { reportDiagnostics: true });
2267
+ if (output.diagnostics.length > 0) {
2268
+ throw new Error(`Syntax error in ${basePath}: ${output.diagnostics[0].messageText}`);
2269
+ }
2270
+ runCode(output.outputText, state);
2271
}
2272
2273
function runCode(code: string, state: TestState): void {
0 commit comments