From f9131cc07f9d8f6448f4e2032feed43995cbe5ad Mon Sep 17 00:00:00 2001 From: zebpaa Date: Mon, 8 Jul 2024 20:45:18 +0400 Subject: [PATCH] changed method of tests --- __tests__/index.tests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/index.tests.js b/__tests__/index.tests.js index fd98117..9bbdfd5 100644 --- a/__tests__/index.tests.js +++ b/__tests__/index.tests.js @@ -12,8 +12,8 @@ const readFile = (filename) => fs.readFileSync(getFixturePath(filename), 'utf-8' test.each(['json', 'yml', 'yaml'])('gendiff_test_format', (format) => { const filepath1 = getFixturePath(`file1.${format}`); const filepath2 = getFixturePath(`file2.${format}`); - expect(gendiff(filepath1, filepath2)).toBe(readFile('expectedStylish.txt')); - expect(gendiff(filepath1, filepath2, 'stylish')).toBe(readFile('expectedStylish.txt')); - expect(gendiff(filepath1, filepath2, 'plain')).toBe(readFile('expectedPlain.txt')); - expect(gendiff(filepath1, filepath2, 'json')).toBe(readFile('expectedJson.json')); + expect(gendiff(filepath1, filepath2)).toEqual(readFile('expectedStylish.txt')); + expect(gendiff(filepath1, filepath2, 'stylish')).toEqual(readFile('expectedStylish.txt')); + expect(gendiff(filepath1, filepath2, 'plain')).toEqual(readFile('expectedPlain.txt')); + expect(gendiff(filepath1, filepath2, 'json')).toEqual(readFile('expectedJson.json')); });