use transpileModule
This commit is contained in:
parent
eac7a48c5f
commit
40f0c6018d
1 changed files with 5 additions and 1 deletions
|
@ -2263,7 +2263,11 @@ namespace FourSlash {
|
|||
// Parse out the files and their metadata
|
||||
const testData = parseTestData(basePath, content, fileName);
|
||||
const state = new TestState(basePath, testType, testData);
|
||||
runCode(ts.transpile(content), state);
|
||||
const output = ts.transpileModule(content, { reportDiagnostics: true });
|
||||
if (output.diagnostics.length > 0) {
|
||||
throw new Error(`Syntax error in ${basePath}: ${output.diagnostics[0].messageText}`);
|
||||
}
|
||||
runCode(output.outputText, state);
|
||||
}
|
||||
|
||||
function runCode(code: string, state: TestState): void {
|
||||
|
|
Loading…
Reference in a new issue