Skip to content

Commit e0bf799

Browse files
committed
Force quotes formatting tests
1 parent c9b1b91 commit e0bf799

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/quotes.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ describe('Always use quotes for names and strings', () => {
1111
'{"SomeField":"кириллиц А"}',
1212
'{"AField":"\\""}'
1313
].forEach(s => {
14-
it('sould be unchanged', () => {
14+
it('sould remain unchanged', () => {
1515
assert.strictEqual(mojangson.stringify(mojangson.parse(s), true), s)
1616
})
17+
});
18+
// Formatting tests
19+
[
20+
['{var: value1, var1:123b, "var2":value3, "var3": "value4"}', '{"var":"value1","var1":123b,"var2":"value3","var3":"value4"}'],
21+
['{SomeField: кириллицА}', '{"SomeField":"кириллицА"}']
22+
].forEach(([input, expected]) => {
23+
it('sould be equal', () => {
24+
assert.strictEqual(mojangson.stringify(mojangson.parse(input), true), expected)
25+
})
1726
})
1827
})

0 commit comments

Comments
 (0)