fastify-cli
Version:
Run a fastify route with one command!
29 lines (23 loc) • 649 B
JavaScript
const { test } = require('node:test')
const assert = require('node:assert')
const Fastify = require('fastify')
const Support = require('../../plugins/support')
test('support works standalone', async (t) => {
const fastify = Fastify()
fastify.register(Support)
await fastify.ready()
assert.equal(fastify.someSupport(), 'hugs')
})
// You can also use plugin with opts in fastify v2
//
// test('support works standalone', (t) => {
// t.plan(2)
// const fastify = Fastify()
// fastify.register(Support)
//
// fastify.ready((err) => {
// t.error(err)
// assert.equal(fastify.someSupport(), 'hugs')
// })
// })