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,32 +1,30 @@
'use strict'
const { test } = require('tap')
const { test } = require('node:test')
const fp = require('../plugin')
test('checkVersion having require.main.filename', (t) => {
const info = console.info
t.ok(require.main.filename)
t.teardown(() => {
t.assert.ok(require.main.filename)
t.after(() => {
console.info = info
})
console.info = function (msg) {
t.fail('logged: ' + msg)
t.assert.fail('logged: ' + msg)
}
fp((fastify, opts, next) => {
fp((_fastify, _opts, next) => {
next()
}, {
fastify: '^4.0.0'
fastify: '^5.0.0'
})
t.end()
})
test('checkVersion having no require.main.filename but process.argv[1]', (t) => {
const filename = require.main.filename
const info = console.info
t.teardown(() => {
t.after(() => {
require.main.filename = filename
console.info = info
})
@@ -34,23 +32,21 @@ test('checkVersion having no require.main.filename but process.argv[1]', (t) =>
require.main.filename = null
console.info = function (msg) {
t.fail('logged: ' + msg)
t.assert.fail('logged: ' + msg)
}
fp((fastify, opts, next) => {
fp((_fastify, _opts, next) => {
next()
}, {
fastify: '^4.0.0'
fastify: '^5.0.0'
})
t.end()
})
test('checkVersion having no require.main.filename and no process.argv[1]', (t) => {
const filename = require.main.filename
const argv = process.argv
const info = console.info
t.teardown(() => {
t.after(() => {
require.main.filename = filename
process.argv = argv
console.info = info
@@ -60,14 +56,12 @@ test('checkVersion having no require.main.filename and no process.argv[1]', (t)
process.argv[1] = null
console.info = function (msg) {
t.fail('logged: ' + msg)
t.assert.fail('logged: ' + msg)
}
fp((fastify, opts, next) => {
fp((_fastify, _opts, next) => {
next()
}, {
fastify: '^4.0.0'
fastify: '^5.0.0'
})
t.end()
})