Skip to content

Commit 29b3f8d

Browse files
committed
update __tests__/index.test.js
1 parent 1689735 commit 29b3f8d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

__tests__/index.test.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import fs from 'fs';
33
import path from 'path';
44
import genDiff from '../src/index.js';
55
import parseFile from '../src/parsers.js';
6+
import stylish from '../src/formatters/stylish.js';
7+
import plain from '../src/formatters/plain.js';
68

79
const __filename = fileURLToPath(import.meta.url);
810
const __dirname = path.dirname(__filename);
@@ -58,7 +60,23 @@ describe('empty files', () => {
5860
});
5961

6062
describe('parsers', () => {
61-
test('parse invalid extension', () => {
63+
test('parse invalid file extension', () => {
6264
expect(() => parseFile({ key: 'value' }, '.txt')).toThrow();
6365
});
6466
});
67+
68+
describe('formatters when dealing with unsupported types', () => {
69+
test('stylish', () => {
70+
expect(() => stylish([
71+
{ key: 'value', type: 'added' },
72+
{ key: 'value', type: 'complex' },
73+
])).toThrow();
74+
});
75+
76+
test('plain', () => {
77+
expect(() => plain([
78+
{ key: 'value', type: 'unchanged' },
79+
{ key: 'value', type: 'complex' },
80+
])).toThrow();
81+
});
82+
});

0 commit comments

Comments
 (0)