UNPKG

fastify-swagger

Version:

Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation

30 lines (22 loc) 526 B
'use strict' const { test } = require('tap') const Fastify = require('fastify') const fastifySwagger = require('../index') test('fastify.swagger should exist', t => { t.plan(2) const fastify = Fastify() fastify.register(fastifySwagger) fastify.ready(err => { t.error(err) t.ok(fastify.swagger) }) }) test('fastify.swaggerCSP should exist', t => { t.plan(2) const fastify = Fastify() fastify.register(fastifySwagger) fastify.ready(err => { t.error(err) t.ok(fastify.swaggerCSP) }) })