Aktueller Stand
This commit is contained in:
12
backend/node_modules/fast-json-stringify/test/invalidSchema.test.js
generated
vendored
12
backend/node_modules/fast-json-stringify/test/invalidSchema.test.js
generated
vendored
@@ -1,12 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
const test = require('tap').test
|
||||
const { test } = require('node:test')
|
||||
const build = require('..')
|
||||
|
||||
// Covers issue #139
|
||||
test('Should throw on invalid schema', t => {
|
||||
t.plan(2)
|
||||
try {
|
||||
t.plan(1)
|
||||
t.assert.throws(() => {
|
||||
build({}, {
|
||||
schema: {
|
||||
invalid: {
|
||||
@@ -14,9 +14,5 @@ test('Should throw on invalid schema', t => {
|
||||
}
|
||||
}
|
||||
})
|
||||
t.fail('should be an invalid schema')
|
||||
} catch (err) {
|
||||
t.match(err.message, /^"invalid" schema is invalid:.*/, 'Schema contains invalid key')
|
||||
t.ok(err)
|
||||
}
|
||||
}, { message: /^"invalid" schema is invalid:.*/ })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user