fastify 3.16.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GOVERNANCE.md +1 -1
- package/docs/Ecosystem.md +1 -0
- package/docs/Reply.md +16 -0
- package/docs/Request.md +2 -0
- package/docs/Server.md +31 -4
- package/docs/TypeScript.md +9 -1
- package/fastify.d.ts +1 -1
- package/fastify.js +27 -22
- package/lib/handleRequest.js +6 -2
- package/lib/hooks.js +2 -1
- package/lib/pluginOverride.js +5 -0
- package/lib/pluginUtils.js +1 -3
- package/lib/reply.js +21 -12
- package/lib/request.js +5 -1
- package/lib/route.js +1 -1
- package/lib/symbols.js +1 -0
- package/lib/wrapThenable.js +6 -3
- package/package.json +2 -2
- package/test/decorator.test.js +39 -0
- package/test/internals/handleRequest.test.js +8 -3
- package/test/internals/reply.test.js +0 -16
- package/test/pretty-print.test.js +89 -0
- package/test/types/fastify.test-d.ts +13 -2
- package/test/versioned-routes.test.js +1 -1
- package/test/wrapThenable.test.js +1 -2
- package/flamegraph.html +0 -88256
- package/test/internals/version.test.js +0 -43
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const t = require('tap')
|
|
4
|
-
const test = t.test
|
|
5
|
-
const proxyquire = require('proxyquire')
|
|
6
|
-
|
|
7
|
-
test('should output an undefined version in case of package.json not available', t => {
|
|
8
|
-
const Fastify = proxyquire('../..', { fs: { accessSync: () => { throw Error('error') } } })
|
|
9
|
-
t.plan(1)
|
|
10
|
-
const srv = Fastify()
|
|
11
|
-
t.equal(srv.version, undefined)
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test('should output an undefined version in case of package.json is not the fastify one', t => {
|
|
15
|
-
const Fastify = proxyquire('../..', { fs: { accessSync: () => { }, readFileSync: () => JSON.stringify({ name: 'foo', version: '6.6.6' }) } })
|
|
16
|
-
t.plan(1)
|
|
17
|
-
const srv = Fastify()
|
|
18
|
-
t.equal(srv.version, undefined)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
test('should skip the version check if the version is undefined', t => {
|
|
22
|
-
const Fastify = proxyquire('../..', { fs: { accessSync: () => { }, readFileSync: () => JSON.stringify({ name: 'foo', version: '6.6.6' }) } })
|
|
23
|
-
t.plan(3)
|
|
24
|
-
const srv = Fastify()
|
|
25
|
-
t.equal(srv.version, undefined)
|
|
26
|
-
|
|
27
|
-
plugin[Symbol.for('skip-override')] = false
|
|
28
|
-
plugin[Symbol.for('plugin-meta')] = {
|
|
29
|
-
name: 'plugin',
|
|
30
|
-
fastify: '>=99.0.0'
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
srv.register(plugin)
|
|
34
|
-
|
|
35
|
-
srv.ready((err) => {
|
|
36
|
-
t.error(err)
|
|
37
|
-
t.pass('everything right')
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
function plugin (instance, opts, done) {
|
|
41
|
-
done()
|
|
42
|
-
}
|
|
43
|
-
})
|