revert one
This commit is contained in:
2025-09-20 13:26:52 +00:00
parent c74f28caa7
commit a2271529a8
2539 changed files with 0 additions and 365006 deletions

View File

@@ -1,10 +0,0 @@
import { errorCodes } from '../../fastify.js'
import { test } from 'node:test'
test('errorCodes in ESM', async t => {
// test a custom fastify error using errorCodes with ESM
const customError = errorCodes.FST_ERR_VALIDATION('custom error message')
t.assert.ok(typeof customError !== 'undefined')
t.assert.ok(customError instanceof errorCodes.FST_ERR_VALIDATION)
t.assert.strictEqual(customError.message, 'custom error message')
})

View File

@@ -1,13 +0,0 @@
import { test } from 'node:test'
import Fastify from '../../fastify.js'
test('esm support', async t => {
const fastify = Fastify()
fastify.register(import('./plugin.mjs'), { foo: 'bar' })
fastify.register(import('./other.mjs'))
await fastify.ready()
t.assert.strictEqual(fastify.foo, 'bar')
})

View File

@@ -1,8 +0,0 @@
'use strict'
import('./named-exports.mjs')
.catch(err => {
process.nextTick(() => {
throw err
})
})

View File

@@ -1,14 +0,0 @@
import { test } from 'node:test'
import { fastify } from '../../fastify.js'
// This test is executed in index.test.js
test('named exports support', async t => {
const app = fastify()
app.register(import('./plugin.mjs'), { foo: 'bar' })
app.register(import('./other.mjs'))
await app.ready()
t.assert.strictEqual(app.foo, 'bar')
})

View File

@@ -1,8 +0,0 @@
// Imported in both index.test.js & esm.test.mjs
import { strictEqual } from 'node:assert'
async function other (fastify, opts) {
strictEqual(fastify.foo, 'bar')
}
export default other

View File

@@ -1,8 +0,0 @@
// Imported in both index.test.js & esm.test.mjs
async function plugin (fastify, opts) {
fastify.decorate('foo', opts.foo)
}
plugin[Symbol.for('skip-override')] = true
export default plugin