fastify 4.27.0 → 5.0.0-alpha.2
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/.markdownlint-cli2.yaml +1 -1
- package/.tap/processinfo/09002e93-10ad-430c-bc86-c0576928b0ed.json +241 -0
- package/.tap/processinfo/ee66c5ab-635d-48b5-8be6-3dc3ceea5bfc.json +268 -0
- package/.tap/test-results/test/404s.test.js.tap +623 -0
- package/.tap/test-results/test/500s.test.js.tap +64 -0
- package/.tap/test-results/test/allowUnsafeRegex.test.js.tap +36 -0
- package/.tap/test-results/test/als.test.js.tap +15 -0
- package/.tap/test-results/test/async-await.test.js.tap +184 -0
- package/.tap/test-results/test/async-dispose.test.js.tap +8 -0
- package/.tap/test-results/test/async_hooks.test.js.tap +10 -0
- package/.tap/test-results/test/bodyLimit.test.js.tap +48 -0
- package/.tap/test-results/test/buffer.test.js.tap +20 -0
- package/.tap/test-results/test/build/error-serializer.test.js.tap +12 -0
- package/.tap/test-results/test/build/version.test.js.tap +7 -0
- package/.tap/test-results/test/case-insensitive.test.js.tap +36 -0
- package/.tap/test-results/test/chainable.test.js.tap +17 -0
- package/.tap/test-results/test/check.test.js.tap +10 -0
- package/.tap/test-results/test/childLoggerFactory.test.js.tap +23 -0
- package/.tap/test-results/test/client-timeout.test.js.tap +7 -0
- package/.tap/test-results/test/close-pipelining.test.js.tap +15 -0
- package/.tap/test-results/test/close.test.js.tap +172 -0
- package/.tap/test-results/test/connectionTimeout.test.js.tap +12 -0
- package/.tap/test-results/test/constrained-routes.test.js.tap +173 -0
- package/.tap/test-results/test/content-length.test.js.tap +46 -0
- package/.tap/test-results/test/content-parser.test.js.tap +266 -0
- package/.tap/test-results/test/content-type.test.js.tap +14 -0
- package/.tap/test-results/test/context-config.test.js.tap +41 -0
- package/.tap/test-results/test/copy.test.js.tap +14 -0
- package/.tap/test-results/test/custom-http-server.test.js.tap +30 -0
- package/.tap/test-results/test/custom-parser-async.test.js.tap +21 -0
- package/.tap/test-results/test/custom-parser.0.test.js.tap +199 -0
- package/.tap/test-results/test/custom-parser.1.test.js.tap +90 -0
- package/.tap/test-results/test/custom-parser.2.test.js.tap +22 -0
- package/.tap/test-results/test/custom-parser.3.test.js.tap +53 -0
- package/.tap/test-results/test/custom-parser.4.test.js.tap +45 -0
- package/.tap/test-results/test/custom-parser.5.test.js.tap +41 -0
- package/.tap/test-results/test/custom-querystring-parser.test.js.tap +46 -0
- package/.tap/test-results/test/decorator.test.js.tap +465 -0
- package/.tap/test-results/test/delete.test.js.tap +110 -0
- package/.tap/test-results/test/diagnostics-channel/404.test.js.tap +15 -0
- package/.tap/test-results/test/diagnostics-channel/async-delay-request.test.js.tap +25 -0
- package/.tap/test-results/test/diagnostics-channel/async-request.test.js.tap +24 -0
- package/.tap/test-results/test/diagnostics-channel/error-before-handler.test.js.tap +9 -0
- package/.tap/test-results/test/diagnostics-channel/error-request.test.js.tap +20 -0
- package/.tap/test-results/test/diagnostics-channel/error-status.test.js.tap +10 -0
- package/.tap/test-results/test/diagnostics-channel/init.test.js.tap +14 -0
- package/.tap/test-results/test/diagnostics-channel/sync-delay-request.test.js.tap +16 -0
- package/.tap/test-results/test/diagnostics-channel/sync-request-reply.test.js.tap +16 -0
- package/.tap/test-results/test/diagnostics-channel/sync-request.test.js.tap +19 -0
- package/.tap/test-results/test/encapsulated-child-logger-factory.test.js.tap +18 -0
- package/.tap/test-results/test/encapsulated-error-handler.test.js.tap +243 -0
- package/.tap/test-results/test/esm/errorCodes.test.mjs.tap +9 -0
- package/.tap/test-results/test/esm/esm.test.mjs.tap +8 -0
- package/.tap/test-results/test/esm/index.test.js.tap +8 -0
- package/.tap/test-results/test/fastify-instance.test.js.tap +114 -0
- package/.tap/test-results/test/findRoute.test.js.tap +37 -0
- package/.tap/test-results/test/fluent-schema.test.js.tap +36 -0
- package/.tap/test-results/test/genReqId.test.js.tap +106 -0
- package/.tap/test-results/test/get.test.js.tap +151 -0
- package/.tap/test-results/test/handler-context.test.js.tap +19 -0
- package/.tap/test-results/test/has-route.test.js.tap +30 -0
- package/.tap/test-results/test/head.test.js.tap +130 -0
- package/.tap/test-results/test/header-overflow.test.js.tap +16 -0
- package/.tap/test-results/test/hooks-async.test.js.tap +286 -0
- package/.tap/test-results/test/hooks.on-listen.test.js.tap +311 -0
- package/.tap/test-results/test/hooks.on-ready.test.js.tap +151 -0
- package/.tap/test-results/test/hooks.test.js.tap +966 -0
- package/.tap/test-results/test/http2/closing.test.js.tap +35 -0
- package/.tap/test-results/test/http2/constraint.test.js.tap +32 -0
- package/.tap/test-results/test/http2/head.test.js.tap +9 -0
- package/.tap/test-results/test/http2/missing-http2-module.test.js.tap +8 -0
- package/.tap/test-results/test/http2/plain.test.js.tap +22 -0
- package/.tap/test-results/test/http2/secure-with-fallback.test.js.tap +40 -0
- package/.tap/test-results/test/http2/secure.test.js.tap +27 -0
- package/.tap/test-results/test/http2/unknown-http-method.test.js.tap +9 -0
- package/.tap/test-results/test/https/custom-https-server.test.js.tap +10 -0
- package/.tap/test-results/test/https/https.test.js.tap +45 -0
- package/.tap/test-results/test/imports.test.js.tap +14 -0
- package/.tap/test-results/test/inject.test.js.tap +165 -0
- package/.tap/test-results/test/internals/all.test.js.tap +42 -0
- package/.tap/test-results/test/internals/contentTypeParser.test.js.tap +14 -0
- package/.tap/test-results/test/internals/context.test.js.tap +14 -0
- package/.tap/test-results/test/internals/decorator.test.js.tap +51 -0
- package/.tap/test-results/test/internals/errors.test.js.tap +1212 -0
- package/.tap/test-results/test/internals/handleRequest.test.js.tap +69 -0
- package/.tap/test-results/test/internals/hookRunner.test.js.tap +143 -0
- package/.tap/test-results/test/internals/hooks.test.js.tap +45 -0
- package/.tap/test-results/test/internals/initialConfig.test.js.tap +125 -0
- package/.tap/test-results/test/internals/logger.test.js.tap +71 -0
- package/.tap/test-results/test/internals/plugin.test.js.tap +48 -0
- package/.tap/test-results/test/internals/reply-serialize.test.js.tap +166 -0
- package/.tap/test-results/test/internals/reply.test.js.tap +688 -0
- package/.tap/test-results/test/internals/reqIdGenFactory.test.js.tap +74 -0
- package/.tap/test-results/test/internals/request-validate.test.js.tap +384 -0
- package/.tap/test-results/test/internals/request.test.js.tap +163 -0
- package/.tap/test-results/test/internals/server.test.js.tap +30 -0
- package/.tap/test-results/test/internals/validation.test.js.tap +121 -0
- package/.tap/test-results/test/keepAliveTimeout.test.js.tap +12 -0
- package/.tap/test-results/test/listen.1.test.js.tap +31 -0
- package/.tap/test-results/test/listen.2.test.js.tap +46 -0
- package/.tap/test-results/test/listen.3.test.js.tap +25 -0
- package/.tap/test-results/test/listen.4.test.js.tap +51 -0
- package/.tap/test-results/test/lock.test.js.tap +29 -0
- package/.tap/test-results/test/logger/instantiation.test.js.tap +92 -0
- package/.tap/test-results/test/logger/logging.test.js.tap +117 -0
- package/.tap/test-results/test/logger/options.test.js.tap +165 -0
- package/.tap/test-results/test/logger/request.test.js.tap +82 -0
- package/.tap/test-results/test/logger/response.test.js.tap +38 -0
- package/.tap/test-results/test/maxRequestsPerSocket.test.js.tap +44 -0
- package/.tap/test-results/test/method-missing.test.js.tap +8 -0
- package/.tap/test-results/test/middleware.test.js.tap +17 -0
- package/.tap/test-results/test/mkcalendar.test.js.tap +43 -0
- package/.tap/test-results/test/mkcol.test.js.tap +14 -0
- package/.tap/test-results/test/move.test.js.tap +15 -0
- package/.tap/test-results/test/noop-set.test.js.tap +8 -0
- package/.tap/test-results/test/nullable-validation.test.js.tap +36 -0
- package/.tap/test-results/test/options.error-handler.test.js.tap +186 -0
- package/.tap/test-results/test/options.test.js.tap +174 -0
- package/.tap/test-results/test/output-validation.test.js.tap +66 -0
- package/.tap/test-results/test/patch.error-handler.test.js.tap +206 -0
- package/.tap/test-results/test/patch.test.js.tap +182 -0
- package/.tap/test-results/test/plugin.1.test.js.tap +78 -0
- package/.tap/test-results/test/plugin.2.test.js.tap +102 -0
- package/.tap/test-results/test/plugin.3.test.js.tap +58 -0
- package/.tap/test-results/test/plugin.4.test.js.tap +164 -0
- package/.tap/test-results/test/post-empty-body.test.js.tap +8 -0
- package/.tap/test-results/test/pretty-print.test.js.tap +82 -0
- package/.tap/test-results/test/promises.test.js.tap +46 -0
- package/.tap/test-results/test/propfind.test.js.tap +43 -0
- package/.tap/test-results/test/proppatch.test.js.tap +29 -0
- package/.tap/test-results/test/proto-poisoning.test.js.tap +47 -0
- package/.tap/test-results/test/put.error-handler.test.js.tap +206 -0
- package/.tap/test-results/test/put.test.js.tap +182 -0
- package/.tap/test-results/test/register.test.js.tap +61 -0
- package/.tap/test-results/test/reply-code.test.js.tap +40 -0
- package/.tap/test-results/test/reply-earlyHints.test.js.tap +22 -0
- package/.tap/test-results/test/reply-error.test.js.tap +643 -0
- package/.tap/test-results/test/reply-trailers.test.js.tap +176 -0
- package/.tap/test-results/test/report.test.js.tap +43 -0
- package/.tap/test-results/test/request-error.test.js.tap +98 -0
- package/.tap/test-results/test/request-id.test.js.tap +38 -0
- package/.tap/test-results/test/request.deprecated.test.js.tap +13 -0
- package/.tap/test-results/test/requestTimeout.test.js.tap +21 -0
- package/.tap/test-results/test/route-hooks.test.js.tap +498 -0
- package/.tap/test-results/test/route-prefix.test.js.tap +195 -0
- package/.tap/test-results/test/route-shorthand.test.js.tap +190 -0
- package/.tap/test-results/test/route.1.test.js.tap +93 -0
- package/.tap/test-results/test/route.2.test.js.tap +28 -0
- package/.tap/test-results/test/route.3.test.js.tap +39 -0
- package/.tap/test-results/test/route.4.test.js.tap +32 -0
- package/.tap/test-results/test/route.5.test.js.tap +54 -0
- package/.tap/test-results/test/route.6.test.js.tap +81 -0
- package/.tap/test-results/test/route.7.test.js.tap +93 -0
- package/.tap/test-results/test/route.8.test.js.tap +38 -0
- package/.tap/test-results/test/router-options.test.js.tap +104 -0
- package/.tap/test-results/test/same-shape.test.js.tap +22 -0
- package/.tap/test-results/test/schema-examples.test.js.tap +85 -0
- package/.tap/test-results/test/schema-feature.test.js.tap +445 -0
- package/.tap/test-results/test/schema-serialization.test.js.tap +194 -0
- package/.tap/test-results/test/schema-special-usage.test.js.tap +186 -0
- package/.tap/test-results/test/schema-validation.test.js.tap +199 -0
- package/.tap/test-results/test/search.test.js.tap +77 -0
- package/.tap/test-results/test/serialize-response.test.js.tap +26 -0
- package/.tap/test-results/test/server.test.js.tap +65 -0
- package/.tap/test-results/test/set-error-handler.test.js.tap +7 -0
- package/.tap/test-results/test/skip-reply-send.test.js.tap +272 -0
- package/.tap/test-results/test/stream.1.test.js.tap +36 -0
- package/.tap/test-results/test/stream.2.test.js.tap +20 -0
- package/.tap/test-results/test/stream.3.test.js.tap +34 -0
- package/.tap/test-results/test/stream.4.test.js.tap +40 -0
- package/.tap/test-results/test/stream.5.test.js.tap +37 -0
- package/.tap/test-results/test/sync-routes.test.js.tap +19 -0
- package/.tap/test-results/test/throw.test.js.tap +116 -0
- package/.tap/test-results/test/trace.test.js.tap +7 -0
- package/.tap/test-results/test/trust-proxy.test.js.tap +109 -0
- package/.tap/test-results/test/type-provider.test.js.tap +12 -0
- package/.tap/test-results/test/unlock.test.js.tap +14 -0
- package/.tap/test-results/test/upgrade.test.js.tap +8 -0
- package/.tap/test-results/test/url-rewriting.test.js.tap +39 -0
- package/.tap/test-results/test/useSemicolonDelimiter.test.js.tap +33 -0
- package/.tap/test-results/test/validation-error-handling.test.js.tap +180 -0
- package/.tap/test-results/test/versioned-routes.test.js.tap +151 -0
- package/.tap/test-results/test/web-api.test.js.tap +51 -0
- package/.tap/test-results/test/wrapThenable.test.js.tap +11 -0
- package/.taprc +4 -8
- package/README.md +3 -6
- package/build/build-error-serializer.js +4 -1
- package/build/build-validation.js +5 -4
- package/docs/Guides/Database.md +1 -1
- package/docs/Guides/Delay-Accepting-Requests.md +3 -3
- package/docs/Guides/Ecosystem.md +2 -0
- package/docs/Guides/Migration-Guide-V5.md +20 -0
- package/docs/Guides/Write-Type-Provider.md +4 -2
- package/docs/Reference/ContentTypeParser.md +30 -1
- package/docs/Reference/Decorators.md +42 -16
- package/docs/Reference/Errors.md +10 -2
- package/docs/Reference/Hooks.md +48 -14
- package/docs/Reference/Logging.md +5 -5
- package/docs/Reference/Reply.md +29 -24
- package/docs/Reference/Request.md +5 -1
- package/docs/Reference/Routes.md +24 -28
- package/docs/Reference/Server.md +14 -53
- package/docs/Reference/Type-Providers.md +21 -26
- package/docs/Reference/TypeScript.md +46 -29
- package/docs/Reference/Warnings.md +2 -8
- package/eslint.config.js +27 -0
- package/examples/typescript-server.ts +14 -14
- package/fastify.d.ts +15 -14
- package/fastify.js +41 -15
- package/lib/configValidator.js +94 -76
- package/lib/contentTypeParser.js +54 -88
- package/lib/decorate.js +3 -7
- package/lib/error-serializer.js +77 -19
- package/lib/errors.js +31 -6
- package/lib/handleRequest.js +70 -39
- package/lib/httpMethods.js +34 -18
- package/lib/logger.js +24 -6
- package/lib/pluginUtils.js +5 -5
- package/lib/reply.js +16 -13
- package/lib/request.js +37 -19
- package/lib/route.js +7 -31
- package/lib/server.js +62 -123
- package/lib/warnings.js +28 -27
- package/lib/wrapThenable.js +46 -22
- package/package.json +38 -58
- package/test/404s.test.js +8 -12
- package/test/async-await.test.js +46 -2
- package/test/build/error-serializer.test.js +4 -2
- package/test/check.test.js +225 -0
- package/test/close-pipelining.test.js +2 -34
- package/test/close.test.js +1 -41
- package/test/content-parser.test.js +69 -117
- package/test/custom-parser.1.test.js +40 -1
- package/test/decorator-namespace.test._js_ +31 -0
- package/test/decorator.test.js +92 -43
- package/test/delete.test.js +21 -1
- package/test/diagnostics-channel/404.test.js +57 -0
- package/test/diagnostics-channel/async-delay-request.test.js +74 -0
- package/test/diagnostics-channel/async-request.test.js +72 -0
- package/test/diagnostics-channel/error-before-handler.test.js +36 -0
- package/test/diagnostics-channel/error-request.test.js +61 -0
- package/test/diagnostics-channel/error-status.test.js +39 -0
- package/test/{diagnostics-channel.test.js → diagnostics-channel/init.test.js} +6 -16
- package/test/diagnostics-channel/sync-delay-request.test.js +58 -0
- package/test/diagnostics-channel/sync-request-reply.test.js +58 -0
- package/test/diagnostics-channel/sync-request.test.js +61 -0
- package/test/encapsulated-error-handler.test.js +201 -14
- package/test/esm/index.test.js +2 -12
- package/test/findRoute.test.js +16 -0
- package/test/genReqId.test.js +9 -0
- package/test/get.test.js +28 -0
- package/test/has-route.test.js +18 -2
- package/test/helper.js +1 -5
- package/test/hooks.test.js +0 -4
- package/test/http2/constraint.test.js +22 -1
- package/test/http2/plain.test.js +21 -6
- package/test/http2/secure.test.js +12 -1
- package/test/https/https.test.js +57 -0
- package/test/inject.test.js +1 -2
- package/test/internals/decorator.test.js +0 -2
- package/test/internals/errors.test.js +57 -17
- package/test/internals/handleRequest.test.js +5 -1
- package/test/internals/initialConfig.test.js +5 -5
- package/test/internals/logger.test.js +31 -2
- package/test/internals/reply.test.js +38 -80
- package/test/internals/request.test.js +13 -11
- package/test/listen.1.test.js +5 -15
- package/test/listen.5.test.js +88 -0
- package/test/logger/instantiation.test.js +8 -8
- package/test/logger/logging.test.js +4 -4
- package/test/logger/options.test.js +102 -21
- package/test/logger/response.test.js +6 -6
- package/test/maxRequestsPerSocket.test.js +2 -5
- package/test/method-missing.test.js +24 -0
- package/test/plugin.1.test.js +2 -4
- package/test/plugin.2.test.js +0 -2
- package/test/plugin.3.test.js +0 -2
- package/test/plugin.4.test.js +92 -56
- package/test/register.test.js +2 -4
- package/test/reply-earlyHints.test.js +98 -0
- package/test/reply-error.test.js +0 -2
- package/test/route-hooks.test.js +0 -1
- package/test/route-shorthand.test.js +60 -0
- package/test/schema-special-usage.test.js +1 -1
- package/test/server.test.js +17 -2
- package/test/stream.2.test.js +1 -1
- package/test/stream.4.test.js +0 -42
- package/test/stream.5.test.js +2 -2
- package/test/trust-proxy.test.js +33 -27
- package/test/types/errors.test-d.ts +0 -2
- package/test/types/fastify.test-d.ts +14 -12
- package/test/types/hooks.test-d.ts +1 -0
- package/test/types/import.ts +1 -0
- package/test/types/instance.test-d.ts +10 -51
- package/test/types/logger.test-d.ts +43 -6
- package/test/types/plugin.test-d.ts +5 -2
- package/test/types/register.test-d.ts +2 -2
- package/test/types/reply.test-d.ts +13 -12
- package/test/types/request.test-d.ts +19 -8
- package/test/types/route.test-d.ts +30 -2
- package/test/types/schema.test-d.ts +2 -2
- package/test/types/serverFactory.test-d.ts +1 -1
- package/test/types/type-provider.test-d.ts +60 -13
- package/test/types/using.test-d.ts +4 -1
- package/test/url-rewriting.test.js +3 -2
- package/test/useSemicolonDelimiter.test.js +3 -6
- package/test/versioned-routes.test.js +1 -1
- package/test/web-api.test.js +0 -6
- package/types/content-type-parser.d.ts +3 -3
- package/types/context.d.ts +0 -1
- package/types/errors.d.ts +1 -0
- package/types/hooks.d.ts +6 -6
- package/types/instance.d.ts +28 -41
- package/types/logger.d.ts +3 -3
- package/types/plugin.d.ts +3 -3
- package/types/reply.d.ts +13 -14
- package/types/request.d.ts +5 -3
- package/types/route.d.ts +29 -29
- package/types/schema.d.ts +3 -3
- package/types/serverFactory.d.ts +2 -2
- package/types/type-provider.d.ts +22 -12
- package/types/utils.d.ts +18 -18
- package/.c8rc.json +0 -8
- package/.eslintrc +0 -4
- package/test/default-route.test.js +0 -88
- package/test/listen.deprecated.test.js +0 -229
- package/test/unsupported-httpversion.test.js +0 -31
- package/types/.eslintrc.json +0 -48
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: basic test
|
|
3
|
+
1..3
|
|
4
|
+
ok 1 - should not error
|
|
5
|
+
ok 2 - should be equivalent
|
|
6
|
+
ok 3 - should be equal
|
|
7
|
+
ok 1 - basic test # time=28.183ms
|
|
8
|
+
|
|
9
|
+
# Subtest: custom serializer options
|
|
10
|
+
1..3
|
|
11
|
+
ok 1 - should not error
|
|
12
|
+
ok 2 - it must use the ceil rounding
|
|
13
|
+
ok 3 - should be equal
|
|
14
|
+
ok 2 - custom serializer options # time=5.486ms
|
|
15
|
+
|
|
16
|
+
# Subtest: Different content types
|
|
17
|
+
1..32
|
|
18
|
+
ok 1 - should be equal
|
|
19
|
+
ok 2 - should be equal
|
|
20
|
+
ok 3 - should not error
|
|
21
|
+
ok 4 - should be equal
|
|
22
|
+
ok 5 - should be equal
|
|
23
|
+
ok 6 - should not error
|
|
24
|
+
ok 7 - should be equal
|
|
25
|
+
ok 8 - should be equal
|
|
26
|
+
ok 9 - should not error
|
|
27
|
+
ok 10 - should be equal
|
|
28
|
+
ok 11 - should be equal
|
|
29
|
+
ok 12 - should not error
|
|
30
|
+
ok 13 - should be equal
|
|
31
|
+
ok 14 - should be equal
|
|
32
|
+
ok 15 - should not error
|
|
33
|
+
ok 16 - should be equal
|
|
34
|
+
ok 17 - should be equal
|
|
35
|
+
ok 18 - should not error
|
|
36
|
+
ok 19 - should be equal
|
|
37
|
+
ok 20 - should be equal
|
|
38
|
+
ok 21 - should not error
|
|
39
|
+
ok 22 - should be equal
|
|
40
|
+
ok 23 - should be equal
|
|
41
|
+
ok 24 - should not error
|
|
42
|
+
ok 25 - should be equal
|
|
43
|
+
ok 26 - should be equal
|
|
44
|
+
ok 27 - should not error
|
|
45
|
+
ok 28 - should be equal
|
|
46
|
+
ok 29 - should be equal
|
|
47
|
+
ok 30 - should not error
|
|
48
|
+
ok 31 - should be equal
|
|
49
|
+
ok 32 - should be equal
|
|
50
|
+
ok 3 - Different content types # time=16.209ms
|
|
51
|
+
|
|
52
|
+
# Subtest: Invalid multiple content schema, throw FST_ERR_SCH_CONTENT_MISSING_SCHEMA error
|
|
53
|
+
1..3
|
|
54
|
+
ok 1 - should be equal
|
|
55
|
+
ok 2 - should be equal
|
|
56
|
+
ok 3 - should be equal
|
|
57
|
+
ok 4 - Invalid multiple content schema, throw FST_ERR_SCH_CONTENT_MISSING_SCHEMA error # time=2.109ms
|
|
58
|
+
|
|
59
|
+
# Subtest: Use the same schema id in different places
|
|
60
|
+
1..2
|
|
61
|
+
ok 1 - should not error
|
|
62
|
+
ok 2 - should be equivalent
|
|
63
|
+
ok 5 - Use the same schema id in different places # time=4.586ms
|
|
64
|
+
|
|
65
|
+
# Subtest: Use shared schema and $ref with $id in response ($ref to $id)
|
|
66
|
+
1..5
|
|
67
|
+
ok 1 - should not error
|
|
68
|
+
ok 2 - should be equivalent
|
|
69
|
+
ok 3 - should not error
|
|
70
|
+
ok 4 - should be equal
|
|
71
|
+
ok 5 - should be equivalent
|
|
72
|
+
ok 6 - Use shared schema and $ref with $id in response ($ref to $id) # time=27.493ms
|
|
73
|
+
|
|
74
|
+
# Subtest: Shared schema should be pass to serializer and validator ($ref to shared schema /definitions)
|
|
75
|
+
1..5
|
|
76
|
+
ok 1 - should not error
|
|
77
|
+
ok 2 - should be equivalent
|
|
78
|
+
ok 3 - should not error
|
|
79
|
+
ok 4 - should be equal
|
|
80
|
+
ok 5 - should be equivalent
|
|
81
|
+
ok 7 - Shared schema should be pass to serializer and validator ($ref to shared schema /definitions) # time=18.677ms
|
|
82
|
+
|
|
83
|
+
# Subtest: Custom setSerializerCompiler
|
|
84
|
+
1..7
|
|
85
|
+
ok 1 - the serializer is set by the parent
|
|
86
|
+
ok 2 - should be equal
|
|
87
|
+
ok 3 - should be equal
|
|
88
|
+
ok 4 - should be equal
|
|
89
|
+
ok 5 - should be equivalent
|
|
90
|
+
ok 6 - should not error
|
|
91
|
+
ok 7 - should be equal
|
|
92
|
+
ok 8 - Custom setSerializerCompiler # time=4.914ms
|
|
93
|
+
|
|
94
|
+
# Subtest: Custom setSerializerCompiler returns bad serialized output
|
|
95
|
+
1..4
|
|
96
|
+
ok 1 - returning an invalid serialization
|
|
97
|
+
ok 2 - should not error
|
|
98
|
+
ok 3 - should be equal
|
|
99
|
+
ok 4 - should be equivalent strictly
|
|
100
|
+
ok 9 - Custom setSerializerCompiler returns bad serialized output # time=1.963ms
|
|
101
|
+
|
|
102
|
+
# Subtest: Custom setSerializerCompiler with addSchema
|
|
103
|
+
1..6
|
|
104
|
+
ok 1 - should be equal
|
|
105
|
+
ok 2 - should be equal
|
|
106
|
+
ok 3 - should be equal
|
|
107
|
+
ok 4 - should be equivalent
|
|
108
|
+
ok 5 - should not error
|
|
109
|
+
ok 6 - should be equal
|
|
110
|
+
ok 10 - Custom setSerializerCompiler with addSchema # time=1.414ms
|
|
111
|
+
|
|
112
|
+
# Subtest: Custom serializer per route
|
|
113
|
+
ok 1 - should be equal
|
|
114
|
+
ok 2 - should be equal
|
|
115
|
+
ok 3 - should be equal
|
|
116
|
+
ok 4 - the custom and route serializer has been called
|
|
117
|
+
1..4
|
|
118
|
+
ok 11 - Custom serializer per route # time=3.942ms
|
|
119
|
+
|
|
120
|
+
# Subtest: Reply serializer win over serializer
|
|
121
|
+
1..6
|
|
122
|
+
ok 1 - the custom compiler has been created
|
|
123
|
+
ok 2 - the custom compiler has been created
|
|
124
|
+
ok 3 - should be equivalent
|
|
125
|
+
ok 4 - should not error
|
|
126
|
+
ok 5 - should be equivalent
|
|
127
|
+
ok 6 - should be equal
|
|
128
|
+
ok 12 - Reply serializer win over serializer # time=2.374ms
|
|
129
|
+
|
|
130
|
+
# Subtest: Reply serializer win over serializer
|
|
131
|
+
1..6
|
|
132
|
+
ok 1 - the custom compiler has been created
|
|
133
|
+
ok 2 - the custom compiler has been created
|
|
134
|
+
ok 3 - should be equivalent
|
|
135
|
+
ok 4 - should not error
|
|
136
|
+
ok 5 - should be equivalent
|
|
137
|
+
ok 6 - should be equal
|
|
138
|
+
ok 13 - Reply serializer win over serializer # time=1.862ms
|
|
139
|
+
|
|
140
|
+
# Subtest: The schema compiler recreate itself if needed
|
|
141
|
+
1..1
|
|
142
|
+
ok 1 - should not error
|
|
143
|
+
ok 14 - The schema compiler recreate itself if needed # time=3.137ms
|
|
144
|
+
|
|
145
|
+
# Subtest: The schema changes the default error handler output
|
|
146
|
+
1..4
|
|
147
|
+
ok 1 - should be equal
|
|
148
|
+
ok 2 - should be equivalent
|
|
149
|
+
ok 3 - should be equal
|
|
150
|
+
ok 4 - should be equivalent
|
|
151
|
+
ok 15 - The schema changes the default error handler output # time=3.599ms
|
|
152
|
+
|
|
153
|
+
# Subtest: do not crash if status code serializer errors
|
|
154
|
+
ok 1 - should be equal
|
|
155
|
+
ok 2 - should be equivalent
|
|
156
|
+
1..2
|
|
157
|
+
ok 16 - do not crash if status code serializer errors # time=13.323ms
|
|
158
|
+
|
|
159
|
+
# Subtest: custom schema serializer error, empty message
|
|
160
|
+
1..2
|
|
161
|
+
ok 1 - should be equal
|
|
162
|
+
ok 2 - should be equivalent
|
|
163
|
+
ok 17 - custom schema serializer error, empty message # time=2.94ms
|
|
164
|
+
|
|
165
|
+
# Subtest: error in custom schema serialize compiler, throw FST_ERR_SCH_SERIALIZATION_BUILD error
|
|
166
|
+
1..3
|
|
167
|
+
ok 1 - should be equal
|
|
168
|
+
ok 2 - should be equal
|
|
169
|
+
ok 3 - should be equal
|
|
170
|
+
ok 18 - error in custom schema serialize compiler, throw FST_ERR_SCH_SERIALIZATION_BUILD error # time=2.946ms
|
|
171
|
+
|
|
172
|
+
# Subtest: Errors in serializer send to errorHandler
|
|
173
|
+
ok 1 - should be equal
|
|
174
|
+
ok 2 - should be equivalent
|
|
175
|
+
ok 3 - error presents
|
|
176
|
+
ok 4 - Serialization sign presents
|
|
177
|
+
1..4
|
|
178
|
+
ok 19 - Errors in serializer send to errorHandler # time=2.344ms
|
|
179
|
+
|
|
180
|
+
# Subtest: capital X
|
|
181
|
+
1..3
|
|
182
|
+
ok 1 - should not error
|
|
183
|
+
ok 2 - should be equivalent
|
|
184
|
+
ok 3 - should be equal
|
|
185
|
+
ok 20 - capital X # time=2.48ms
|
|
186
|
+
|
|
187
|
+
# Subtest: allow default as status code and used as last fallback
|
|
188
|
+
1..3
|
|
189
|
+
ok 1 - should not error
|
|
190
|
+
ok 2 - should be equivalent
|
|
191
|
+
ok 3 - should be equal
|
|
192
|
+
ok 21 - allow default as status code and used as last fallback # time=2.284ms
|
|
193
|
+
|
|
194
|
+
1..21
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: Ajv plugins array parameter
|
|
3
|
+
1..3
|
|
4
|
+
ok 1 - should not error
|
|
5
|
+
ok 2 - should be equal
|
|
6
|
+
ok 3 - should be equal
|
|
7
|
+
ok 1 - Ajv plugins array parameter # time=49.666ms
|
|
8
|
+
|
|
9
|
+
# Subtest: Should handle root $merge keywords in header
|
|
10
|
+
1..5
|
|
11
|
+
ok 1 - should not error
|
|
12
|
+
ok 2 - should not error
|
|
13
|
+
ok 3 - should be equal
|
|
14
|
+
ok 4 - should not error
|
|
15
|
+
ok 5 - should be equal
|
|
16
|
+
ok 2 - Should handle root $merge keywords in header # time=18.987ms
|
|
17
|
+
|
|
18
|
+
# Subtest: Should handle root $patch keywords in header
|
|
19
|
+
1..5
|
|
20
|
+
ok 1 - should not error
|
|
21
|
+
ok 2 - should not error
|
|
22
|
+
ok 3 - should be equal
|
|
23
|
+
ok 4 - should not error
|
|
24
|
+
ok 5 - should be equal
|
|
25
|
+
ok 3 - Should handle root $patch keywords in header # time=14.592ms
|
|
26
|
+
|
|
27
|
+
# Subtest: Should handle $merge keywords in body
|
|
28
|
+
1..5
|
|
29
|
+
ok 1 - should not error
|
|
30
|
+
ok 2 - should not error
|
|
31
|
+
ok 3 - should be equal
|
|
32
|
+
ok 4 - should not error
|
|
33
|
+
ok 5 - should be equal
|
|
34
|
+
ok 4 - Should handle $merge keywords in body # time=36.887ms
|
|
35
|
+
|
|
36
|
+
# Subtest: Should handle $patch keywords in body
|
|
37
|
+
1..5
|
|
38
|
+
ok 1 - should not error
|
|
39
|
+
ok 2 - should not error
|
|
40
|
+
ok 3 - should be equal
|
|
41
|
+
ok 4 - should not error
|
|
42
|
+
ok 5 - should be equal
|
|
43
|
+
ok 5 - Should handle $patch keywords in body # time=16.101ms
|
|
44
|
+
|
|
45
|
+
# Subtest: serializer read validator's schemas
|
|
46
|
+
1..4
|
|
47
|
+
ok 1 - is always empty because fastify.addSchema is not called
|
|
48
|
+
ok 2 - should not error
|
|
49
|
+
ok 3 - should be equal
|
|
50
|
+
ok 4 - should be equivalent
|
|
51
|
+
ok 6 - serializer read validator's schemas # time=29.393ms
|
|
52
|
+
|
|
53
|
+
# Subtest: setSchemaController in a plugin
|
|
54
|
+
1..5
|
|
55
|
+
ok 1 - the bucket is created
|
|
56
|
+
ok 2 - the querystring schema is compiled
|
|
57
|
+
ok 3 - should not error
|
|
58
|
+
ok 4 - should be equal
|
|
59
|
+
ok 5 - should be equivalent
|
|
60
|
+
ok 7 - setSchemaController in a plugin # time=30.223ms
|
|
61
|
+
|
|
62
|
+
# Subtest: side effect on schema let the server crash
|
|
63
|
+
1..0
|
|
64
|
+
ok 8 - side effect on schema let the server crash # time=13.138ms
|
|
65
|
+
|
|
66
|
+
# Subtest: only response schema trigger AJV pollution
|
|
67
|
+
1..0
|
|
68
|
+
ok 9 - only response schema trigger AJV pollution # time=21.053ms
|
|
69
|
+
|
|
70
|
+
# Subtest: only response schema trigger AJV pollution \#2
|
|
71
|
+
1..0
|
|
72
|
+
ok 10 - only response schema trigger AJV pollution \#2 # time=16.319ms
|
|
73
|
+
|
|
74
|
+
# Subtest: setSchemaController in a plugin with head routes
|
|
75
|
+
1..6
|
|
76
|
+
ok 1 - the bucket is created
|
|
77
|
+
ok 2 - the schema is reused
|
|
78
|
+
ok 3 - the schema is reused
|
|
79
|
+
ok 4 - should not error
|
|
80
|
+
ok 5 - should be equal
|
|
81
|
+
ok 6 - should be equivalent
|
|
82
|
+
ok 11 - setSchemaController in a plugin with head routes # time=8.034ms
|
|
83
|
+
|
|
84
|
+
# Subtest: multiple refs with the same ids
|
|
85
|
+
1..3
|
|
86
|
+
ok 1 - should not error
|
|
87
|
+
ok 2 - should be equal
|
|
88
|
+
ok 3 - should be equivalent
|
|
89
|
+
ok 12 - multiple refs with the same ids # time=11.382ms
|
|
90
|
+
|
|
91
|
+
# Subtest: JOI validation overwrite request headers
|
|
92
|
+
1..3
|
|
93
|
+
ok 1 - should not error
|
|
94
|
+
ok 2 - should be equal
|
|
95
|
+
ok 3 - should be equivalent
|
|
96
|
+
ok 13 - JOI validation overwrite request headers # time=4.882ms
|
|
97
|
+
|
|
98
|
+
# Subtest: Custom schema object should not trigger FST_ERR_SCH_DUPLICATE
|
|
99
|
+
ok 1 - fastify is ready
|
|
100
|
+
1..1
|
|
101
|
+
ok 14 - Custom schema object should not trigger FST_ERR_SCH_DUPLICATE # time=4.96ms
|
|
102
|
+
|
|
103
|
+
# Subtest: The default schema compilers should not be called when overwritten by the user
|
|
104
|
+
ok 1 - The custom validator compiler should be called
|
|
105
|
+
ok 2 - The custom serializer compiler should be called
|
|
106
|
+
1..2
|
|
107
|
+
ok 15 - The default schema compilers should not be called when overwritten by the user # time=34.686ms
|
|
108
|
+
|
|
109
|
+
# Subtest: Supports async JOI validation
|
|
110
|
+
1..7
|
|
111
|
+
ok 1 - should be equal
|
|
112
|
+
ok 2 - should not error
|
|
113
|
+
ok 3 - should be equal
|
|
114
|
+
ok 4 - should be equivalent
|
|
115
|
+
ok 5 - should not error
|
|
116
|
+
ok 6 - should be equal
|
|
117
|
+
ok 7 - should be equivalent
|
|
118
|
+
ok 16 - Supports async JOI validation # time=4.826ms
|
|
119
|
+
|
|
120
|
+
# Subtest: Supports async AJV validation
|
|
121
|
+
1..12
|
|
122
|
+
ok 1 - should not error
|
|
123
|
+
ok 2 - should be equal
|
|
124
|
+
ok 3 - should be equivalent
|
|
125
|
+
ok 4 - should not error
|
|
126
|
+
ok 5 - should be equal
|
|
127
|
+
ok 6 - should be equivalent
|
|
128
|
+
ok 7 - should not error
|
|
129
|
+
ok 8 - should be equal
|
|
130
|
+
ok 9 - should be equivalent
|
|
131
|
+
ok 10 - should not error
|
|
132
|
+
ok 11 - should be equal
|
|
133
|
+
ok 12 - should be equivalent
|
|
134
|
+
ok 17 - Supports async AJV validation # time=20.957ms
|
|
135
|
+
|
|
136
|
+
# Subtest: Check all the async AJV validation paths
|
|
137
|
+
1..10
|
|
138
|
+
ok 1 - should not error
|
|
139
|
+
ok 2 - should be equal
|
|
140
|
+
ok 3 - should not error
|
|
141
|
+
ok 4 - should be equal
|
|
142
|
+
ok 5 - should not error
|
|
143
|
+
ok 6 - should be equal
|
|
144
|
+
ok 7 - should not error
|
|
145
|
+
ok 8 - should be equal
|
|
146
|
+
ok 9 - should not error
|
|
147
|
+
ok 10 - should be equal
|
|
148
|
+
ok 18 - Check all the async AJV validation paths # time=20.086ms
|
|
149
|
+
|
|
150
|
+
# Subtest: Check mixed sync and async AJV validations
|
|
151
|
+
1..12
|
|
152
|
+
ok 1 - should not error
|
|
153
|
+
ok 2 - should be equal
|
|
154
|
+
ok 3 - should not error
|
|
155
|
+
ok 4 - should be equal
|
|
156
|
+
ok 5 - should not error
|
|
157
|
+
ok 6 - should be equal
|
|
158
|
+
ok 7 - should not error
|
|
159
|
+
ok 8 - should be equal
|
|
160
|
+
ok 9 - should not error
|
|
161
|
+
ok 10 - should be equal
|
|
162
|
+
ok 11 - should not error
|
|
163
|
+
ok 12 - should be equal
|
|
164
|
+
ok 19 - Check mixed sync and async AJV validations # time=13.124ms
|
|
165
|
+
|
|
166
|
+
# Subtest: Check if hooks and attachValidation work with AJV validations
|
|
167
|
+
1..16
|
|
168
|
+
ok 1 - should be equal
|
|
169
|
+
ok 2 - preHandler called
|
|
170
|
+
ok 3 - should not error
|
|
171
|
+
ok 4 - should be equal
|
|
172
|
+
ok 5 - should be equal
|
|
173
|
+
ok 6 - preHandler called
|
|
174
|
+
ok 7 - should not error
|
|
175
|
+
ok 8 - should be equal
|
|
176
|
+
ok 9 - should be equal
|
|
177
|
+
ok 10 - preHandler called
|
|
178
|
+
ok 11 - should not error
|
|
179
|
+
ok 12 - should be equal
|
|
180
|
+
ok 13 - should be equal
|
|
181
|
+
ok 14 - preHandler called
|
|
182
|
+
ok 15 - should not error
|
|
183
|
+
ok 16 - should be equal
|
|
184
|
+
ok 20 - Check if hooks and attachValidation work with AJV validations # time=9.884ms
|
|
185
|
+
|
|
186
|
+
1..20
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: Basic validation test
|
|
3
|
+
1..6
|
|
4
|
+
ok 1 - should not error
|
|
5
|
+
ok 2 - should be equivalent
|
|
6
|
+
ok 3 - should be equal
|
|
7
|
+
ok 4 - should not error
|
|
8
|
+
ok 5 - should be equivalent
|
|
9
|
+
ok 6 - should be equal
|
|
10
|
+
ok 1 - Basic validation test # time=45.735ms
|
|
11
|
+
|
|
12
|
+
# Subtest: External AJV instance
|
|
13
|
+
1..5
|
|
14
|
+
ok 1 - custom validator compiler called
|
|
15
|
+
ok 2 - should not error
|
|
16
|
+
ok 3 - should be equal
|
|
17
|
+
ok 4 - should not error
|
|
18
|
+
ok 5 - should be equal
|
|
19
|
+
ok 2 - External AJV instance # time=17.754ms
|
|
20
|
+
|
|
21
|
+
# Subtest: Encapsulation
|
|
22
|
+
1..21
|
|
23
|
+
ok 1 - custom validator compiler called
|
|
24
|
+
ok 2 - custom validator compiler called
|
|
25
|
+
ok 3 - should not error
|
|
26
|
+
ok 4 - should be equal
|
|
27
|
+
ok 5 - should be equivalent
|
|
28
|
+
ok 6 - should not error
|
|
29
|
+
ok 7 - should be equal
|
|
30
|
+
ok 8 - should be equivalent
|
|
31
|
+
ok 9 - should not error
|
|
32
|
+
ok 10 - should be equal
|
|
33
|
+
ok 11 - should be equivalent
|
|
34
|
+
ok 12 - should not error
|
|
35
|
+
ok 13 - should be equal
|
|
36
|
+
ok 14 - the route validator does not change the instance one
|
|
37
|
+
ok 15 - should not error
|
|
38
|
+
ok 16 - should be equal
|
|
39
|
+
ok 17 - should be equivalent
|
|
40
|
+
ok 18 - should be equal
|
|
41
|
+
ok 19 - should not error
|
|
42
|
+
ok 20 - should be equal
|
|
43
|
+
ok 21 - should be equivalent
|
|
44
|
+
ok 3 - Encapsulation # time=27.712ms
|
|
45
|
+
|
|
46
|
+
# Subtest: Triple $ref with a simple $id
|
|
47
|
+
1..7
|
|
48
|
+
ok 1 - custom validator compiler called
|
|
49
|
+
ok 2 - should not error
|
|
50
|
+
ok 3 - should be equal
|
|
51
|
+
ok 4 - should be equivalent
|
|
52
|
+
ok 5 - should not error
|
|
53
|
+
ok 6 - should be equal
|
|
54
|
+
ok 7 - should be equivalent
|
|
55
|
+
ok 4 - Triple $ref with a simple $id # time=27.037ms
|
|
56
|
+
|
|
57
|
+
# Subtest: Extending schema
|
|
58
|
+
1..4
|
|
59
|
+
ok 1 - should not error
|
|
60
|
+
ok 2 - should be equal
|
|
61
|
+
ok 3 - should not error
|
|
62
|
+
ok 4 - should be equal
|
|
63
|
+
ok 5 - Extending schema # time=13.35ms
|
|
64
|
+
|
|
65
|
+
# Subtest: Should work with nested ids
|
|
66
|
+
1..6
|
|
67
|
+
ok 1 - should not error
|
|
68
|
+
ok 2 - should be equal
|
|
69
|
+
ok 3 - should be equal
|
|
70
|
+
ok 4 - should not error
|
|
71
|
+
ok 5 - should be equal
|
|
72
|
+
ok 6 - should be equal
|
|
73
|
+
ok 6 - Should work with nested ids # time=10.977ms
|
|
74
|
+
|
|
75
|
+
# Subtest: Use the same schema across multiple routes
|
|
76
|
+
1..8
|
|
77
|
+
ok 1 - should not error
|
|
78
|
+
ok 2 - should be equal
|
|
79
|
+
ok 3 - should not error
|
|
80
|
+
ok 4 - should be equal
|
|
81
|
+
ok 5 - should not error
|
|
82
|
+
ok 6 - should be equal
|
|
83
|
+
ok 7 - should not error
|
|
84
|
+
ok 8 - should be equal
|
|
85
|
+
ok 7 - Use the same schema across multiple routes # time=10.493ms
|
|
86
|
+
|
|
87
|
+
# Subtest: JSON Schema validation keywords
|
|
88
|
+
1..6
|
|
89
|
+
ok 1 - should not error
|
|
90
|
+
ok 2 - should be equal
|
|
91
|
+
ok 3 - should be equal
|
|
92
|
+
ok 4 - should not error
|
|
93
|
+
ok 5 - should be equal
|
|
94
|
+
ok 6 - should be equivalent
|
|
95
|
+
ok 8 - JSON Schema validation keywords # time=7.764ms
|
|
96
|
+
|
|
97
|
+
# Subtest: Nested id calls
|
|
98
|
+
1..6
|
|
99
|
+
ok 1 - should not error
|
|
100
|
+
ok 2 - should be equal
|
|
101
|
+
ok 3 - should be equal
|
|
102
|
+
ok 4 - should not error
|
|
103
|
+
ok 5 - should be equal
|
|
104
|
+
ok 6 - should be equivalent
|
|
105
|
+
ok 9 - Nested id calls # time=8.117ms
|
|
106
|
+
|
|
107
|
+
# Subtest: Use the same schema id in different places
|
|
108
|
+
1..2
|
|
109
|
+
ok 1 - should not error
|
|
110
|
+
ok 2 - should be equivalent
|
|
111
|
+
ok 10 - Use the same schema id in different places # time=17.978ms
|
|
112
|
+
|
|
113
|
+
# Subtest: Use shared schema and $ref with $id ($ref to $id)
|
|
114
|
+
1..5
|
|
115
|
+
ok 1 - should not error
|
|
116
|
+
ok 2 - should be equivalent
|
|
117
|
+
ok 3 - should not error
|
|
118
|
+
ok 4 - should be equal
|
|
119
|
+
ok 5 - should be equivalent
|
|
120
|
+
ok 11 - Use shared schema and $ref with $id ($ref to $id) # time=13.293ms
|
|
121
|
+
|
|
122
|
+
# Subtest: Use items with $ref
|
|
123
|
+
1..4
|
|
124
|
+
ok 1 - should not error
|
|
125
|
+
ok 2 - should be equal
|
|
126
|
+
ok 3 - should not error
|
|
127
|
+
ok 4 - should be equal
|
|
128
|
+
ok 12 - Use items with $ref # time=7.212ms
|
|
129
|
+
|
|
130
|
+
# Subtest: Use $ref to /definitions
|
|
131
|
+
1..6
|
|
132
|
+
ok 1 - should not error
|
|
133
|
+
ok 2 - should be equal
|
|
134
|
+
ok 3 - should be equivalent
|
|
135
|
+
ok 4 - should not error
|
|
136
|
+
ok 5 - should be equal
|
|
137
|
+
ok 6 - should be equivalent
|
|
138
|
+
ok 13 - Use $ref to /definitions # time=11.981ms
|
|
139
|
+
|
|
140
|
+
# Subtest: Custom AJV settings - pt1
|
|
141
|
+
1..4
|
|
142
|
+
ok 1 - should be equal
|
|
143
|
+
ok 2 - should not error
|
|
144
|
+
ok 3 - should be equal
|
|
145
|
+
ok 4 - should be equivalent
|
|
146
|
+
ok 14 - Custom AJV settings - pt1 # time=23.444ms
|
|
147
|
+
|
|
148
|
+
# Subtest: Custom AJV settings - pt2
|
|
149
|
+
1..2
|
|
150
|
+
ok 1 - should not error
|
|
151
|
+
ok 2 - should be equal
|
|
152
|
+
ok 15 - Custom AJV settings - pt2 # time=23.994ms
|
|
153
|
+
|
|
154
|
+
# Subtest: Custom AJV settings on different parameters - pt1
|
|
155
|
+
1..2
|
|
156
|
+
ok 1 - should not error
|
|
157
|
+
ok 2 - should be equal
|
|
158
|
+
ok 16 - Custom AJV settings on different parameters - pt1 # time=11.358ms
|
|
159
|
+
|
|
160
|
+
# Subtest: Custom AJV settings on different parameters - pt2
|
|
161
|
+
1..4
|
|
162
|
+
ok 1 - should be equivalent
|
|
163
|
+
ok 2 - should be equivalent
|
|
164
|
+
ok 3 - should be equivalent
|
|
165
|
+
ok 4 - should be equivalent
|
|
166
|
+
ok 17 - Custom AJV settings on different parameters - pt2 # time=10.296ms
|
|
167
|
+
|
|
168
|
+
# Subtest: The same $id in route's schema must not overwrite others
|
|
169
|
+
1..4
|
|
170
|
+
ok 1 - should not error
|
|
171
|
+
ok 2 - should be equivalent
|
|
172
|
+
ok 3 - should not error
|
|
173
|
+
ok 4 - should be equivalent
|
|
174
|
+
ok 18 - The same $id in route's schema must not overwrite others # time=19.122ms
|
|
175
|
+
|
|
176
|
+
# Subtest: Custom validator compiler should not mutate schema
|
|
177
|
+
1..2
|
|
178
|
+
ok 1 - type is Headers
|
|
179
|
+
ok 2 - type is Headers
|
|
180
|
+
ok 19 - Custom validator compiler should not mutate schema # time=1.392ms
|
|
181
|
+
|
|
182
|
+
# Subtest: Custom validator builder override by custom validator compiler
|
|
183
|
+
1..3
|
|
184
|
+
ok 1 - should be equivalent
|
|
185
|
+
ok 2 - should be equivalent
|
|
186
|
+
ok 3 - should be equal
|
|
187
|
+
ok 20 - Custom validator builder override by custom validator compiler # time=7.499ms
|
|
188
|
+
|
|
189
|
+
# Subtest: Custom validator builder override by custom validator compiler in child instance
|
|
190
|
+
1..6
|
|
191
|
+
ok 1 - should be equivalent
|
|
192
|
+
ok 2 - should be equivalent
|
|
193
|
+
ok 3 - should be equal
|
|
194
|
+
ok 4 - should be equivalent
|
|
195
|
+
ok 5 - should be equivalent
|
|
196
|
+
ok 6 - should be equal
|
|
197
|
+
ok 21 - Custom validator builder override by custom validator compiler in child instance # time=10.556ms
|
|
198
|
+
|
|
199
|
+
1..21
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: search
|
|
3
|
+
1..1
|
|
4
|
+
ok 1 - (unnamed test)
|
|
5
|
+
ok 1 - search # time=6.316ms
|
|
6
|
+
|
|
7
|
+
# Subtest: search, params schema
|
|
8
|
+
1..1
|
|
9
|
+
ok 1 - (unnamed test)
|
|
10
|
+
ok 2 - search, params schema # time=0.644ms
|
|
11
|
+
|
|
12
|
+
# Subtest: search, querystring schema
|
|
13
|
+
1..1
|
|
14
|
+
ok 1 - (unnamed test)
|
|
15
|
+
ok 3 - search, querystring schema # time=0.326ms
|
|
16
|
+
|
|
17
|
+
# Subtest: search, body schema
|
|
18
|
+
1..1
|
|
19
|
+
ok 1 - (unnamed test)
|
|
20
|
+
ok 4 - search, body schema # time=0.314ms
|
|
21
|
+
|
|
22
|
+
ok 5 - should not error
|
|
23
|
+
# Subtest: request - search
|
|
24
|
+
1..4
|
|
25
|
+
ok 1 - should not error
|
|
26
|
+
ok 2 - should be equal
|
|
27
|
+
ok 3 - should be equal
|
|
28
|
+
ok 4 - should be equivalent
|
|
29
|
+
ok 6 - request - search # time=13.172ms
|
|
30
|
+
|
|
31
|
+
# Subtest: request search params schema
|
|
32
|
+
1..4
|
|
33
|
+
ok 1 - should not error
|
|
34
|
+
ok 2 - should be equal
|
|
35
|
+
ok 3 - should be equal
|
|
36
|
+
ok 4 - should be equivalent
|
|
37
|
+
ok 7 - request search params schema # time=3.353ms
|
|
38
|
+
|
|
39
|
+
# Subtest: request search params schema error
|
|
40
|
+
1..3
|
|
41
|
+
ok 1 - should not error
|
|
42
|
+
ok 2 - should be equal
|
|
43
|
+
ok 3 - should be equivalent
|
|
44
|
+
ok 8 - request search params schema error # time=2.011ms
|
|
45
|
+
|
|
46
|
+
# Subtest: request search querystring schema
|
|
47
|
+
1..4
|
|
48
|
+
ok 1 - should not error
|
|
49
|
+
ok 2 - should be equal
|
|
50
|
+
ok 3 - should be equal
|
|
51
|
+
ok 4 - should be equivalent
|
|
52
|
+
ok 9 - request search querystring schema # time=1.155ms
|
|
53
|
+
|
|
54
|
+
# Subtest: request search querystring schema error
|
|
55
|
+
1..3
|
|
56
|
+
ok 1 - should not error
|
|
57
|
+
ok 2 - should be equal
|
|
58
|
+
ok 3 - should be equivalent
|
|
59
|
+
ok 10 - request search querystring schema error # time=0.847ms
|
|
60
|
+
|
|
61
|
+
# Subtest: request search body schema
|
|
62
|
+
1..4
|
|
63
|
+
ok 1 - should not error
|
|
64
|
+
ok 2 - should be equal
|
|
65
|
+
ok 3 - should be equal
|
|
66
|
+
ok 4 - should be equivalent
|
|
67
|
+
ok 11 - request search body schema # time=4.603ms
|
|
68
|
+
|
|
69
|
+
# Subtest: request search body schema error
|
|
70
|
+
1..4
|
|
71
|
+
ok 1 - should not error
|
|
72
|
+
ok 2 - should be equal
|
|
73
|
+
ok 3 - should be equal
|
|
74
|
+
ok 4 - should be equivalent
|
|
75
|
+
ok 12 - request search body schema error # time=1.67ms
|
|
76
|
+
|
|
77
|
+
1..12
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: serialize the response for a Bad Request error, as defined on the schema
|
|
3
|
+
1..2
|
|
4
|
+
ok 1 - should be equal
|
|
5
|
+
ok 2 - should be equivalent
|
|
6
|
+
ok 1 - serialize the response for a Bad Request error, as defined on the schema # time=72.63ms
|
|
7
|
+
|
|
8
|
+
# Subtest: serialize the response for a Not Found error, as defined on the schema
|
|
9
|
+
1..2
|
|
10
|
+
ok 1 - should be equal
|
|
11
|
+
ok 2 - should be equivalent
|
|
12
|
+
ok 2 - serialize the response for a Not Found error, as defined on the schema # time=15.37ms
|
|
13
|
+
|
|
14
|
+
# Subtest: serialize the response for a Internal Server Error error, as defined on the schema
|
|
15
|
+
1..2
|
|
16
|
+
ok 1 - should be equal
|
|
17
|
+
ok 2 - should be equivalent
|
|
18
|
+
ok 3 - serialize the response for a Internal Server Error error, as defined on the schema # time=41.881ms
|
|
19
|
+
|
|
20
|
+
# Subtest: serialize the success response, as defined on the schema
|
|
21
|
+
1..2
|
|
22
|
+
ok 1 - should be equal
|
|
23
|
+
ok 2 - should be equivalent
|
|
24
|
+
ok 4 - serialize the success response, as defined on the schema # time=20.964ms
|
|
25
|
+
|
|
26
|
+
1..4
|