Skip to content

Commit

Permalink
Add newline after Json output
Browse files Browse the repository at this point in the history
  • Loading branch information
jessevanassen committed Jan 25, 2023
1 parent 9fa2a46 commit 835eb17
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/jest-core/src/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
);
}
}

Expand Down

0 comments on commit 835eb17

Please sign in to comment.