Skip to content

Commit

Permalink
Fix EOL mismatch resulting in false negative test result (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoldYourWaffle authored Aug 4, 2023
1 parent d4dda1f commit 7efe9c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ function testInput(input) {

it('output should produce the same output as output file', () => {
const outputFilePath = path.join(outputPath, input.output);
const fileContent = JSON.stringify(sortObject(converted), null, 2) + '\n';
const fileContent = sortObject(converted);

if (process.env.WRITE_CONVERTED) {
fs.writeFileSync(outputFilePath, fileContent);
fs.writeFileSync(outputFilePath, JSON.stringify(fileContent, null, 2) + '\n');
}

const outputFile = fs.readFileSync(outputFilePath, 'utf-8');
const outputFile = JSON.parse(fs.readFileSync(outputFilePath, 'utf-8'));
expect(fileContent).to.deep.equal(outputFile);
});
});
Expand Down

0 comments on commit 7efe9c1

Please sign in to comment.