Skip to content

Commit 53494d5

Browse files
committed
Updated test
1 parent ff90167 commit 53494d5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/additionalProperties.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ test('additionalProperties should not change properties and patternProperties',
6565
t.equal('{"ofoo":"42","test":42,"foo":"42"}', stringify(obj))
6666
})
6767

68+
test('additionalProperties set to true, use of fast-safe-stringify', (t) => {
69+
t.plan(1)
70+
const stringify = build({
71+
title: 'check string coerce',
72+
type: 'object',
73+
properties: {},
74+
additionalProperties: true
75+
})
76+
77+
const obj = { foo: true, ofoo: 42, arrfoo: ['array', 'test'], objfoo: { a: 'world' } }
78+
t.equal('{"foo":true,"ofoo":42,"arrfoo":["array","test"],"objfoo":{"a":"world"}}', stringify(obj))
79+
})
80+
6881
test('additionalProperties - string coerce', (t) => {
6982
t.plan(1)
7083
const stringify = build({

0 commit comments

Comments
 (0)