MCPcopy
hub / github.com/fastify/fastify / runTests

Function runTests

test/decorator.test.js:120–134  ·  view source on GitHub ↗
(t, fastifyServer)

Source from the content-addressed store, hash-verified

118})
119
120const runTests = async (t, fastifyServer) => {
121 const endpoints = [
122 { path: '/yes', expectedBody: { hello: 'world' } },
123 { path: '/no', expectedBody: { hello: 'world' } }
124 ]
125
126 for (const { path, expectedBody } of endpoints) {
127 const result = await fetch(`${fastifyServer}${path}`)
128 t.assert.ok(result.ok)
129 t.assert.strictEqual(result.status, 200)
130 const body = await result.text()
131 t.assert.strictEqual(result.headers.get('content-length'), '' + body.length)
132 t.assert.deepStrictEqual(JSON.parse(body), expectedBody)
133 }
134}
135
136test('decorateReply inside register', async (t) => {
137 t.plan(10)

Callers 1

decorator.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected