fatsify核心功能示例测试!!!
This commit is contained in:
18
node_modules/fast-json-stringify/test/invalidSchema.test.js
generated
vendored
Normal file
18
node_modules/fast-json-stringify/test/invalidSchema.test.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('node:test')
|
||||
const build = require('..')
|
||||
|
||||
// Covers issue #139
|
||||
test('Should throw on invalid schema', t => {
|
||||
t.plan(1)
|
||||
t.assert.throws(() => {
|
||||
build({}, {
|
||||
schema: {
|
||||
invalid: {
|
||||
type: 'Dinosaur'
|
||||
}
|
||||
}
|
||||
})
|
||||
}, { message: /^"invalid" schema is invalid:.*/ })
|
||||
})
|
||||
Reference in New Issue
Block a user