Add a newline character to the output of a file #196

Merged
Vylpes merged 1 commit from feature/80-cli-output into develop 2024-07-26 18:18:43 +01:00
2 changed files with 2 additions and 2 deletions

View file

@ -9,7 +9,7 @@ export default class CliHelper {
const output = OutputHelper.GenerateOutput(response, options);
if (options.o) {
writeFileSync(options.o, output);
writeFileSync(options.o, `${output}\n`);
} else {
console.log(output);
}

View file

@ -35,7 +35,7 @@ describe("Endpoint", () => {
expect(OutputHelper.GenerateOutput).toHaveBeenCalledWith(response, options);
expect(fs.writeFileSync).toHaveBeenCalledTimes(1);
expect(fs.writeFileSync).toHaveBeenCalledWith("file.txt", "test output");
expect(fs.writeFileSync).toHaveBeenCalledWith("file.txt", "test output\n");
expect(console.log).not.toHaveBeenCalled();