We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d676d0 commit 9acec40Copy full SHA for 9acec40
test.js
@@ -1,17 +1,20 @@
1
'use strict'
2
3
const test = require('tap').test
4
+const validator = require('is-my-json-valid')
5
const build = require('.')
6
7
function buildTest (schema, toStringify) {
8
test(`render a ${schema.title} as JSON`, (t) => {
- t.plan(2)
9
+ t.plan(3)
10
11
+ const validate = validator(schema)
12
const stringify = build(schema)
13
const output = stringify(toStringify)
14
15
t.deepEqual(JSON.parse(output), toStringify)
16
t.equal(output, JSON.stringify(toStringify))
17
+ t.ok(validate(JSON.parse(output)), 'valid schema')
18
})
19
}
20
0 commit comments