We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 026ab83 commit 9758a48Copy full SHA for 9758a48
__test__/diffFiles.test.js
@@ -1,3 +1,4 @@
1
+/* eslint-disable no-undef */
2
import fs from 'fs';
3
import path from 'path';
4
import compareFiles from '../src/diffFiles.js';
@@ -13,9 +14,11 @@ const getFixturePath = (filename) =>
13
14
const readFile = (filename) =>
15
fs.readFileSync(getFixturePath(filename), 'utf-8');
16
17
+const normalizedString = (str) => str.replace(/\r\n/g, '\n')
18
+
19
test('compareFiles',()=>{
20
const diffFiles = readFile('expectDiffFiles.txt')
21
const file1 = parseFile(getFixturePath('file1.json'));
22
const file2 = parseFile(getFixturePath('file2.json'));
- expect(compareFiles(file1,file2)).toEqual(diffFiles);
23
+ expect(compareFiles(file1,file2)).toEqual(normalizedString(diffFiles));
24
})
0 commit comments