Skip to content

Commit 907e3e1

Browse files
Weakkyblakeembrey
authored andcommittedNov 28, 2019
Pass correct diagnostics list in transpile mode (#917)
1 parent ea6e1da commit 907e3e1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
 

‎src/index.spec.ts

+12
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,18 @@ describe('ts-node', function () {
213213
})
214214
})
215215

216+
it('should throw error even in transpileOnly mode', function (done) {
217+
exec(`${BIN_EXEC} --transpile-only -pe "console."`, function (err) {
218+
if (err === null) {
219+
return done('Command was expected to fail, but it succeeded.')
220+
}
221+
222+
expect(err.message).to.contain('error TS1003: Identifier expected')
223+
224+
return done()
225+
})
226+
})
227+
216228
it('should pipe into `ts-node` and evaluate', function (done) {
217229
const cp = exec(BIN_EXEC, function (err, stdout) {
218230
expect(err).to.equal(null)

‎src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ export function create (options: CreateOptions = {}): Register {
442442
filterDiagnostics(result.diagnostics, ignoreDiagnostics) :
443443
[]
444444

445-
if (diagnosticList.length) reportTSError(configDiagnosticList)
445+
if (diagnosticList.length) reportTSError(diagnosticList)
446446

447447
return [result.outputText, result.sourceMapText as string]
448448
}

0 commit comments

Comments
 (0)