Skip to content

Commit f8c0abf

Browse files
committed
fix import gendiff from diffFiles.test.js
1 parent 0bd641b commit f8c0abf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

__test__/diffFiles.test.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'fs';
33
import path from 'path';
44
import { fileURLToPath } from 'url';
55
import { dirname } from 'path';
6-
import { chooseFormat } from '../src/formatters/index.js';
6+
import genDiff from '../src/formatters/index.js';
77

88
const __filename = fileURLToPath(import.meta.url);
99
const __dirname = dirname(__filename);
@@ -18,29 +18,25 @@ const expectFormatPlain = readFile('expectDiffFormatPlain.txt');
1818
const expectFormatStylish = readFile('expectDiffFormatStylish.txt');
1919

2020
test('compareFilesJsonFormatStylish', () => {
21-
expect(
22-
chooseFormat('__fixtures__/file1.json', '__fixtures__/file2.json')
23-
).toEqual(expectFormatStylish);
21+
expect(genDiff('__fixtures__/file1.json', '__fixtures__/file2.json')).toEqual(
22+
expectFormatStylish
23+
);
2424
});
2525

2626
test('compareFilesYamlFormatStylish', () => {
2727
expect(
28-
chooseFormat(
29-
'__fixtures__/file1.yaml',
30-
'__fixtures__/file2.yaml',
31-
'stylish'
32-
)
28+
genDiff('__fixtures__/file1.yaml', '__fixtures__/file2.yaml', 'stylish')
3329
).toEqual(expectFormatStylish);
3430
});
3531

3632
test('compareFilesJsonFormatPlain', () => {
3733
expect(
38-
chooseFormat('__fixtures__/file1.yaml', '__fixtures__/file2.json', 'plain')
34+
genDiff('__fixtures__/file1.yaml', '__fixtures__/file2.json', 'plain')
3935
).toEqual(expectFormatPlain);
4036
});
4137

4238
test('compareFilesFormatJson', () => {
4339
expect(
44-
chooseFormat('__fixtures__/file1.yaml', '__fixtures__/file2.yaml', 'json')
40+
genDiff('__fixtures__/file1.yaml', '__fixtures__/file2.yaml', 'json')
4541
).toEqual(expectFormatJson);
4642
});

0 commit comments

Comments
 (0)