Skip to content

Commit be2c364

Browse files
committed
Updated test
1 parent 96e6d50 commit be2c364

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/missing-values.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@ test('missing values', (t) => {
2626
t.equal('{"str":"string","val":"value"}', stringify({ str: 'string', val: 'value' }))
2727
t.equal('{"str":"string","num":42,"val":"value"}', stringify({ str: 'string', num: 42, val: 'value' }))
2828
})
29+
30+
test('handle null when value should be string', (t) => {
31+
t.plan(1)
32+
33+
const stringify = build({
34+
type: 'object',
35+
properties: {
36+
str: {
37+
type: 'string'
38+
}
39+
}
40+
})
41+
42+
t.equal('{"str":""}', stringify({ str: null }))
43+
})

0 commit comments

Comments
 (0)