support.test.js 582 B

1234567891011121314151617181920212223242526
  1. 'use strict'
  2. const { test } = require('tap')
  3. const Fastify = require('fastify')
  4. const Support = require('../../plugins/support')
  5. test('support works standalone', (t) => {
  6. t.plan(2)
  7. const fastify = Fastify()
  8. fastify.register(Support)
  9. fastify.ready((err) => {
  10. t.error(err)
  11. t.equal(fastify.someSupport(), 'hugs')
  12. })
  13. })
  14. // If you prefer async/await, use the following
  15. //
  16. // test('support works standalone', async (t) => {
  17. // const fastify = Fastify()
  18. // fastify.register(Support)
  19. //
  20. // await fastify.ready()
  21. // t.equal(fastify.someSupport(), 'hugs')
  22. // })