Skip to content

Commit

Permalink
feat: add EOF at the end of the JSON file
Browse files Browse the repository at this point in the history
  • Loading branch information
joset98 committed Jan 30, 2025
1 parent f6277f4 commit 43a1303
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/translateController.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const translateController = async ({
filesToEdit.forEach(({ file, parsedPath }) => {
setDeepValue(file, nameOfTranslation, result);

fs.writeFileSync(parsedPath, JSON.stringify(file, null, 2));
fs.writeFileSync(parsedPath, JSON.stringify(file, null, 2) + "\n");
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions controllers/translateController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ describe("TranslateController", () => {
},
null,
2,
),
) + "\n",
);

expect(fs.writeFileSync).toHaveBeenNthCalledWith(
Expand All @@ -569,7 +569,7 @@ describe("TranslateController", () => {
},
null,
2,
),
) + "\n",
);

expect(fs.writeFileSync).toHaveBeenCalledTimes(2);
Expand Down

0 comments on commit 43a1303

Please sign in to comment.