Skip to content

Commit 9acec40

Browse files
committed
Added assertion to validate the value out from the schema.
1 parent 7d676d0 commit 9acec40

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
'use strict'
22

33
const test = require('tap').test
4+
const validator = require('is-my-json-valid')
45
const build = require('.')
56

67
function buildTest (schema, toStringify) {
78
test(`render a ${schema.title} as JSON`, (t) => {
8-
t.plan(2)
9+
t.plan(3)
910

11+
const validate = validator(schema)
1012
const stringify = build(schema)
1113
const output = stringify(toStringify)
1214

1315
t.deepEqual(JSON.parse(output), toStringify)
1416
t.equal(output, JSON.stringify(toStringify))
17+
t.ok(validate(JSON.parse(output)), 'valid schema')
1518
})
1619
}
1720

0 commit comments

Comments
 (0)