1 | 'use strict'
|
2 |
|
3 | const t = require('tap')
|
4 | const test = t.test
|
5 | const fastify = require('..')()
|
6 |
|
7 | const noop = () => {}
|
8 | const opts = {
|
9 | schema: {
|
10 | response: {
|
11 | '2xx': {
|
12 | type: 'object',
|
13 | properties: {
|
14 | hello: {
|
15 | type: 'string'
|
16 | }
|
17 | }
|
18 | }
|
19 | }
|
20 | }
|
21 | }
|
22 |
|
23 | test('chainable - get', t => {
|
24 | t.plan(1)
|
25 | t.type(fastify.get('/', opts, noop), fastify)
|
26 | })
|
27 |
|
28 | test('chainable - post', t => {
|
29 | t.plan(1)
|
30 | t.type(fastify.post('/', opts, noop), fastify)
|
31 | })
|
32 |
|
33 | test('chainable - route', t => {
|
34 | t.plan(1)
|
35 | t.type(fastify.route({
|
36 | method: 'GET',
|
37 | url: '/other',
|
38 | schema: opts.schema,
|
39 | handler: noop
|
40 | }), fastify)
|
41 | })
|