1 | const { format } = require('../src');
|
2 |
|
3 | test('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 |
|
13 | test('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 | });
|