page cw
This commit is contained in:
28
test/plugins/support.test.js
Normal file
28
test/plugins/support.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict'
|
||||
|
||||
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')
|
||||
// })
|
||||
// })
|
||||
Reference in New Issue
Block a user