diff --git a/src/errors/index.ts b/src/errors/index.ts index edb57969c..70643db14 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -35,7 +35,7 @@ export function error(input: Error | string, options: {exit?: false | number} & if (options.exit === false) { const message = prettyPrint(err) - if (message) write.stderr(message) + if (message) write.stderr(message + '\n') if (config.errorLogger) config.errorLogger.log(err?.stack ?? '') } else throw err } @@ -52,7 +52,7 @@ export function warn(input: Error | string): void { } const message = prettyPrint(err) - if (message) write.stderr(message) + if (message) write.stderr(message + '\n') if (config.errorLogger) config.errorLogger.log(err?.stack ?? '') } diff --git a/test/config/ts-node.test.ts b/test/config/ts-node.test.ts index 85a5e0bd5..801620a0b 100644 --- a/test/config/ts-node.test.ts +++ b/test/config/ts-node.test.ts @@ -111,6 +111,6 @@ describe('tsPath', () => { const stderrStub = sandbox.stub(write, 'stderr') const result = await configTsNode.tsPath(root, tsSource) expect(result).to.equal(join(root, tsSource)) - expect(stripAnsi(stderrStub.firstCall.firstArg).split('\n').at(-1)).to.include('Falling back to compiled source') + expect(stripAnsi(stderrStub.firstCall.firstArg).split('\n').join(' ')).to.include('Falling back to compiled source') }) })