Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -1,31 +1,32 @@
'use strict'
const t = require('tap')
const test = t.test
const { test } = require('node:test')
const fastifySuccess = require('./dist/success')
const fastifyFailPlugin = require('./dist/failPlugin')
test('Bundled package should work', (t) => {
test('Bundled package should work', (t, done) => {
t.plan(4)
fastifySuccess.ready((err) => {
t.error(err)
t.assert.ifError(err)
fastifySuccess.inject(
{
method: 'GET',
url: '/'
},
(error, res) => {
t.error(error)
t.equal(res.statusCode, 200)
t.same(res.json(), { hello: 'world' })
t.assert.ifError(error)
t.assert.strictEqual(res.statusCode, 200)
t.assert.deepStrictEqual(res.json(), { hello: 'world' })
done()
}
)
})
})
test('Bundled package should not work with bad plugin version', (t) => {
test('Bundled package should not work with bad plugin version', (t, done) => {
t.plan(1)
fastifyFailPlugin.ready((err) => {
t.match(err.message, /expected '9.x' fastify version/i)
t.assert.match(err.message, /expected '9.x' fastify version/i)
done()
})
})