From 835eb178f0948e5c542f1f21ff433dbf8e0f9bb0 Mon Sep 17 00:00:00 2001 From: Jesse van Assen Date: Wed, 25 Jan 2023 14:35:00 +0100 Subject: [PATCH] Add newline after Json output --- packages/jest-core/src/runJest.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/jest-core/src/runJest.ts b/packages/jest-core/src/runJest.ts index 5f0d74cb25d1..9aa77a4346ec 100644 --- a/packages/jest-core/src/runJest.ts +++ b/packages/jest-core/src/runJest.ts @@ -106,12 +106,17 @@ const processResults = async ( const cwd = tryRealpath(process.cwd()); const filePath = path.resolve(cwd, outputFile); - fs.writeFileSync(filePath, JSON.stringify(formatTestResults(runResults))); + fs.writeFileSync( + filePath, + `${JSON.stringify(formatTestResults(runResults))}\n`, + ); outputStream.write( `Test results written to: ${path.relative(cwd, filePath)}\n`, ); } else { - process.stdout.write(JSON.stringify(formatTestResults(runResults))); + process.stdout.write( + `${JSON.stringify(formatTestResults(runResults))}\n`, + ); } }