UNPKG

590 BJavaScriptView Raw
1const { format } = require('../src');
2
3test('It orders contributors in alphabetical order', () => {
4 const json = {
5 contributors: [
6 'Cameron <cameron@email.com> (https://cameronhunter.co.uk)',
7 'Adam <adam@email.com>',
8 'Barry'
9 ]
10 };
11
12 expect(format(json)).toMatchSnapshot();
13});
14
15test('It expands users if requested', () => {
16 const json = {
17 author: 'Cameron <cameron@email.com> (https://cameronhunter.co.uk)',
18 contributors: [
19 'Adam <adam@email.com>',
20 'Barry'
21 ]
22 };
23
24 expect(format(json, { expandUsers: true })).toMatchSnapshot();
25});