UNPKG

446 BJavaScriptView Raw
1const { format } = require('../src');
2
3test('It indents using 2 spaces (default)', () => {
4 const json = {
5 name: 'Test',
6 description: 'Description',
7 version: '0.0.0'
8 };
9
10 expect(format(json)).toMatchSnapshot();
11});
12
13test('It indents using the specified tab width', () => {
14 const json = {
15 name: 'Test',
16 description: 'Description',
17 version: '0.0.0'
18 };
19
20 expect(format(json, { tabWidth: 4 })).toMatchSnapshot();
21});