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,104 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: Should honor ignoreTrailingSlash option
|
|
3
|
+
1..4
|
|
4
|
+
ok 1 - should be equal
|
|
5
|
+
ok 2 - should be equal
|
|
6
|
+
ok 3 - should be equal
|
|
7
|
+
ok 4 - should be equal
|
|
8
|
+
ok 1 - Should honor ignoreTrailingSlash option # time=24.387ms
|
|
9
|
+
|
|
10
|
+
# Subtest: Should honor ignoreDuplicateSlashes option
|
|
11
|
+
1..4
|
|
12
|
+
ok 1 - should be equal
|
|
13
|
+
ok 2 - should be equal
|
|
14
|
+
ok 3 - should be equal
|
|
15
|
+
ok 4 - should be equal
|
|
16
|
+
ok 2 - Should honor ignoreDuplicateSlashes option # time=2.69ms
|
|
17
|
+
|
|
18
|
+
# Subtest: Should honor ignoreTrailingSlash and ignoreDuplicateSlashes options
|
|
19
|
+
1..4
|
|
20
|
+
ok 1 - should be equal
|
|
21
|
+
ok 2 - should be equal
|
|
22
|
+
ok 3 - should be equal
|
|
23
|
+
ok 4 - should be equal
|
|
24
|
+
ok 3 - Should honor ignoreTrailingSlash and ignoreDuplicateSlashes options # time=9.899ms
|
|
25
|
+
|
|
26
|
+
# Subtest: Should honor maxParamLength option
|
|
27
|
+
1..4
|
|
28
|
+
ok 1 - should not error
|
|
29
|
+
ok 2 - should be equal
|
|
30
|
+
ok 3 - should not error
|
|
31
|
+
ok 4 - should be equal
|
|
32
|
+
ok 4 - Should honor maxParamLength option # time=2.528ms
|
|
33
|
+
|
|
34
|
+
# Subtest: Should expose router options via getters on request and reply
|
|
35
|
+
1..9
|
|
36
|
+
ok 1 - should be equal
|
|
37
|
+
ok 2 - should be equal
|
|
38
|
+
ok 3 - should be equivalent
|
|
39
|
+
ok 4 - should be equal
|
|
40
|
+
ok 5 - should be equal
|
|
41
|
+
ok 6 - should be equal
|
|
42
|
+
ok 7 - should be equal
|
|
43
|
+
ok 8 - should not error
|
|
44
|
+
ok 9 - should be equal
|
|
45
|
+
ok 5 - Should expose router options via getters on request and reply # time=25.273ms
|
|
46
|
+
|
|
47
|
+
# Subtest: Should set is404 flag for unmatched paths
|
|
48
|
+
1..3
|
|
49
|
+
ok 1 - should be equal
|
|
50
|
+
ok 2 - should not error
|
|
51
|
+
ok 3 - should be equal
|
|
52
|
+
ok 6 - Should set is404 flag for unmatched paths # time=1.587ms
|
|
53
|
+
|
|
54
|
+
# Subtest: Should honor frameworkErrors option - FST_ERR_BAD_URL
|
|
55
|
+
1..3
|
|
56
|
+
ok 1 - should be equal
|
|
57
|
+
ok 2 - should not error
|
|
58
|
+
ok 3 - should be equal
|
|
59
|
+
ok 7 - Should honor frameworkErrors option - FST_ERR_BAD_URL # time=1.687ms
|
|
60
|
+
|
|
61
|
+
# Subtest: Should supply Fastify request to the logger in frameworkErrors wrapper - FST_ERR_BAD_URL
|
|
62
|
+
1..8
|
|
63
|
+
ok 1 - should be equivalent
|
|
64
|
+
ok 2 - should be equivalent
|
|
65
|
+
ok 3 - should be equivalent
|
|
66
|
+
ok 4 - should be equivalent
|
|
67
|
+
ok 5 - should be equivalent
|
|
68
|
+
ok 6 - should be equivalent
|
|
69
|
+
ok 7 - should not error
|
|
70
|
+
ok 8 - should be equal
|
|
71
|
+
ok 8 - Should supply Fastify request to the logger in frameworkErrors wrapper - FST_ERR_BAD_URL # time=4.376ms
|
|
72
|
+
|
|
73
|
+
# Subtest: Should honor disableRequestLogging option in frameworkErrors wrapper - FST_ERR_BAD_URL
|
|
74
|
+
1..2
|
|
75
|
+
ok 1 - should not error
|
|
76
|
+
ok 2 - should be equal
|
|
77
|
+
ok 9 - Should honor disableRequestLogging option in frameworkErrors wrapper - FST_ERR_BAD_URL # time=1.672ms
|
|
78
|
+
|
|
79
|
+
# Subtest: Should honor frameworkErrors option - FST_ERR_ASYNC_CONSTRAINT
|
|
80
|
+
1..3
|
|
81
|
+
ok 1 - should be equal
|
|
82
|
+
ok 2 - should not error
|
|
83
|
+
ok 3 - should be equal
|
|
84
|
+
ok 10 - Should honor frameworkErrors option - FST_ERR_ASYNC_CONSTRAINT # time=1.809ms
|
|
85
|
+
|
|
86
|
+
# Subtest: Should supply Fastify request to the logger in frameworkErrors wrapper - FST_ERR_ASYNC_CONSTRAINT
|
|
87
|
+
1..8
|
|
88
|
+
ok 1 - should be equivalent
|
|
89
|
+
ok 2 - should be equivalent
|
|
90
|
+
ok 3 - should be equivalent
|
|
91
|
+
ok 4 - should be equivalent
|
|
92
|
+
ok 5 - should be equivalent
|
|
93
|
+
ok 6 - should be equivalent
|
|
94
|
+
ok 7 - should not error
|
|
95
|
+
ok 8 - should be equal
|
|
96
|
+
ok 11 - Should supply Fastify request to the logger in frameworkErrors wrapper - FST_ERR_ASYNC_CONSTRAINT # time=1.813ms
|
|
97
|
+
|
|
98
|
+
# Subtest: Should honor disableRequestLogging option in frameworkErrors wrapper - FST_ERR_ASYNC_CONSTRAINT
|
|
99
|
+
1..2
|
|
100
|
+
ok 1 - should not error
|
|
101
|
+
ok 2 - should be equal
|
|
102
|
+
ok 12 - Should honor disableRequestLogging option in frameworkErrors wrapper - FST_ERR_ASYNC_CONSTRAINT # time=1.468ms
|
|
103
|
+
|
|
104
|
+
1..12
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: same shape on Request
|
|
3
|
+
1..1
|
|
4
|
+
ok 1 - should be equal
|
|
5
|
+
ok 1 - same shape on Request # time=20.589ms
|
|
6
|
+
|
|
7
|
+
# Subtest: same shape on Request when object
|
|
8
|
+
1..1
|
|
9
|
+
ok 1 - should be equal
|
|
10
|
+
ok 2 - same shape on Request when object # time=1.625ms
|
|
11
|
+
|
|
12
|
+
# Subtest: same shape on Reply
|
|
13
|
+
1..1
|
|
14
|
+
ok 1 - should be equal
|
|
15
|
+
ok 3 - same shape on Reply # time=1.517ms
|
|
16
|
+
|
|
17
|
+
# Subtest: same shape on Reply when object
|
|
18
|
+
1..1
|
|
19
|
+
ok 1 - should be equal
|
|
20
|
+
ok 4 - same shape on Reply when object # time=1.31ms
|
|
21
|
+
|
|
22
|
+
1..4
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: Example - URI $id
|
|
3
|
+
1..1
|
|
4
|
+
ok 1 - should not error
|
|
5
|
+
ok 1 - Example - URI $id # time=50.985ms
|
|
6
|
+
|
|
7
|
+
# Subtest: Example - string $id
|
|
8
|
+
1..1
|
|
9
|
+
ok 1 - should not error
|
|
10
|
+
ok 2 - Example - string $id # time=24.654ms
|
|
11
|
+
|
|
12
|
+
# Subtest: Example - get schema
|
|
13
|
+
1..1
|
|
14
|
+
ok 1 - should be equivalent
|
|
15
|
+
ok 3 - Example - get schema # time=0.887ms
|
|
16
|
+
|
|
17
|
+
# Subtest: Example - get schema encapsulated
|
|
18
|
+
ok 1 - should be equivalent
|
|
19
|
+
ok 2 - should be equivalent
|
|
20
|
+
ok 3 - should be equivalent
|
|
21
|
+
1..3
|
|
22
|
+
ok 4 - Example - get schema encapsulated # time=11.204ms
|
|
23
|
+
|
|
24
|
+
# Subtest: Example - validation
|
|
25
|
+
1..1
|
|
26
|
+
ok 1 - should not error
|
|
27
|
+
ok 5 - Example - validation # time=40.06ms
|
|
28
|
+
|
|
29
|
+
# Subtest: Example - ajv config
|
|
30
|
+
1..1
|
|
31
|
+
ok 1 - should not error
|
|
32
|
+
ok 6 - Example - ajv config # time=35.104ms
|
|
33
|
+
|
|
34
|
+
# Subtest: Example Joi
|
|
35
|
+
1..1
|
|
36
|
+
ok 1 - should not error
|
|
37
|
+
ok 7 - Example Joi # time=23.845ms
|
|
38
|
+
|
|
39
|
+
# Subtest: Example yup
|
|
40
|
+
1..1
|
|
41
|
+
ok 1 - should not error
|
|
42
|
+
ok 8 - Example yup # time=12.832ms
|
|
43
|
+
|
|
44
|
+
# Subtest: Example - serialization
|
|
45
|
+
1..1
|
|
46
|
+
ok 1 - should not error
|
|
47
|
+
ok 9 - Example - serialization # time=3.385ms
|
|
48
|
+
|
|
49
|
+
# Subtest: Example - serialization 2
|
|
50
|
+
1..1
|
|
51
|
+
ok 1 - should not error
|
|
52
|
+
ok 10 - Example - serialization 2 # time=1.872ms
|
|
53
|
+
|
|
54
|
+
# Subtest: Example - serializator
|
|
55
|
+
1..1
|
|
56
|
+
ok 1 - should not error
|
|
57
|
+
ok 11 - Example - serializator # time=1.293ms
|
|
58
|
+
|
|
59
|
+
# Subtest: Example - schemas examples
|
|
60
|
+
1..1
|
|
61
|
+
ok 1 - should not error
|
|
62
|
+
ok 12 - Example - schemas examples # time=28.623ms
|
|
63
|
+
|
|
64
|
+
# Subtest: should return custom error messages with ajv-errors
|
|
65
|
+
1..3
|
|
66
|
+
ok 1 - should not error
|
|
67
|
+
ok 2 - should be equivalent
|
|
68
|
+
ok 3 - should be equal
|
|
69
|
+
ok 13 - should return custom error messages with ajv-errors # time=32.176ms
|
|
70
|
+
|
|
71
|
+
# Subtest: should be able to handle formats of ajv-formats when added by plugins option
|
|
72
|
+
1..3
|
|
73
|
+
ok 1 - should be equal
|
|
74
|
+
ok 2 - should be equal
|
|
75
|
+
ok 3 - should be equivalent
|
|
76
|
+
ok 14 - should be able to handle formats of ajv-formats when added by plugins option # time=27.206ms
|
|
77
|
+
|
|
78
|
+
# Subtest: should return localized error messages with ajv-i18n
|
|
79
|
+
1..3
|
|
80
|
+
ok 1 - should not error
|
|
81
|
+
ok 2 - should be equivalent
|
|
82
|
+
ok 3 - should be equal
|
|
83
|
+
ok 15 - should return localized error messages with ajv-i18n # time=20.679ms
|
|
84
|
+
|
|
85
|
+
1..15
|
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
TAP version 14
|
|
2
|
+
# Subtest: Should expose addSchema function
|
|
3
|
+
1..1
|
|
4
|
+
ok 1 - should be equal
|
|
5
|
+
ok 1 - Should expose addSchema function # time=6.888ms
|
|
6
|
+
|
|
7
|
+
# Subtest: Should expose getSchema function
|
|
8
|
+
1..1
|
|
9
|
+
ok 1 - should be equal
|
|
10
|
+
ok 2 - Should expose getSchema function # time=0.492ms
|
|
11
|
+
|
|
12
|
+
# Subtest: Should expose getSchemas function
|
|
13
|
+
1..1
|
|
14
|
+
ok 1 - should be equal
|
|
15
|
+
ok 3 - Should expose getSchemas function # time=0.327ms
|
|
16
|
+
|
|
17
|
+
# Subtest: Should expose setValidatorCompiler function
|
|
18
|
+
1..1
|
|
19
|
+
ok 1 - should be equal
|
|
20
|
+
ok 4 - Should expose setValidatorCompiler function # time=0.307ms
|
|
21
|
+
|
|
22
|
+
# Subtest: Should expose setSerializerCompiler function
|
|
23
|
+
1..1
|
|
24
|
+
ok 1 - should be equal
|
|
25
|
+
ok 5 - Should expose setSerializerCompiler function # time=0.297ms
|
|
26
|
+
|
|
27
|
+
# Subtest: cannot call setValidatorCompiler after binding
|
|
28
|
+
1..2
|
|
29
|
+
ok 1 - should not error
|
|
30
|
+
ok 2 - (unnamed test)
|
|
31
|
+
ok 6 - cannot call setValidatorCompiler after binding # time=29.653ms
|
|
32
|
+
|
|
33
|
+
# Subtest: cannot call setSerializerCompiler after binding
|
|
34
|
+
1..2
|
|
35
|
+
ok 1 - should not error
|
|
36
|
+
ok 2 - (unnamed test)
|
|
37
|
+
ok 7 - cannot call setSerializerCompiler after binding # time=12.35ms
|
|
38
|
+
|
|
39
|
+
# Subtest: The schemas should be added to an internal storage
|
|
40
|
+
1..1
|
|
41
|
+
ok 1 - should be equivalent
|
|
42
|
+
ok 8 - The schemas should be added to an internal storage # time=7.014ms
|
|
43
|
+
|
|
44
|
+
# Subtest: The schemas should be accessible via getSchemas
|
|
45
|
+
1..1
|
|
46
|
+
ok 1 - should be equivalent
|
|
47
|
+
ok 9 - The schemas should be accessible via getSchemas # time=1.046ms
|
|
48
|
+
|
|
49
|
+
# Subtest: The schema should be accessible by id via getSchema
|
|
50
|
+
1..5
|
|
51
|
+
ok 1 - should be equivalent
|
|
52
|
+
ok 2 - should be equivalent
|
|
53
|
+
ok 3 - should be equivalent
|
|
54
|
+
ok 4 - should be equivalent
|
|
55
|
+
ok 5 - should not error
|
|
56
|
+
ok 10 - The schema should be accessible by id via getSchema # time=22.152ms
|
|
57
|
+
|
|
58
|
+
# Subtest: Get validatorCompiler after setValidatorCompiler
|
|
59
|
+
1..2
|
|
60
|
+
ok 1 - should be equal
|
|
61
|
+
ok 2 - should not error
|
|
62
|
+
ok 11 - Get validatorCompiler after setValidatorCompiler # time=1.139ms
|
|
63
|
+
|
|
64
|
+
# Subtest: Get serializerCompiler after setSerializerCompiler
|
|
65
|
+
1..2
|
|
66
|
+
ok 1 - should be equal
|
|
67
|
+
ok 2 - should not error
|
|
68
|
+
ok 12 - Get serializerCompiler after setSerializerCompiler # time=1.071ms
|
|
69
|
+
|
|
70
|
+
# Subtest: Get compilers is empty when settle on routes
|
|
71
|
+
1..3
|
|
72
|
+
ok 1 - should not error
|
|
73
|
+
ok 2 - should be equal
|
|
74
|
+
ok 3 - should be equal
|
|
75
|
+
ok 13 - Get compilers is empty when settle on routes # time=17.815ms
|
|
76
|
+
|
|
77
|
+
# Subtest: Should throw if the $id property is missing
|
|
78
|
+
1..1
|
|
79
|
+
ok 1 - should be equal
|
|
80
|
+
ok 14 - Should throw if the $id property is missing # time=0.481ms
|
|
81
|
+
|
|
82
|
+
# Subtest: Cannot add multiple times the same id
|
|
83
|
+
1..2
|
|
84
|
+
ok 1 - should be equal
|
|
85
|
+
ok 2 - should be equal
|
|
86
|
+
ok 15 - Cannot add multiple times the same id # time=0.394ms
|
|
87
|
+
|
|
88
|
+
# Subtest: Cannot add schema for query and querystring
|
|
89
|
+
1..2
|
|
90
|
+
ok 1 - should be equal
|
|
91
|
+
ok 2 - should be equal
|
|
92
|
+
ok 16 - Cannot add schema for query and querystring # time=1.279ms
|
|
93
|
+
|
|
94
|
+
# Subtest: Should throw of the schema does not exists in input
|
|
95
|
+
1..2
|
|
96
|
+
ok 1 - should be equal
|
|
97
|
+
ok 2 - should be equal
|
|
98
|
+
ok 17 - Should throw of the schema does not exists in input # time=35.148ms
|
|
99
|
+
|
|
100
|
+
# Subtest: Should throw of the schema does not exists in output
|
|
101
|
+
1..2
|
|
102
|
+
ok 1 - should be equal
|
|
103
|
+
ok 2 - should match pattern
|
|
104
|
+
ok 18 - Should throw of the schema does not exists in output # time=5.674ms
|
|
105
|
+
|
|
106
|
+
# Subtest: Should not change the input schemas
|
|
107
|
+
1..4
|
|
108
|
+
ok 1 - should not error
|
|
109
|
+
ok 2 - should be equivalent
|
|
110
|
+
ok 3 - the $id is not removed
|
|
111
|
+
ok 4 - should be equivalent
|
|
112
|
+
ok 19 - Should not change the input schemas # time=19.575ms
|
|
113
|
+
|
|
114
|
+
# Subtest: Should emit warning if the schema headers is undefined
|
|
115
|
+
1..4
|
|
116
|
+
ok 1 - should be equal
|
|
117
|
+
ok 2 - should be equal
|
|
118
|
+
ok 3 - should not error
|
|
119
|
+
ok 4 - should be equal
|
|
120
|
+
ok 20 - Should emit warning if the schema headers is undefined # time=3.425ms
|
|
121
|
+
|
|
122
|
+
# Subtest: Should emit warning if the schema body is undefined
|
|
123
|
+
1..4
|
|
124
|
+
ok 1 - should be equal
|
|
125
|
+
ok 2 - should be equal
|
|
126
|
+
ok 3 - should not error
|
|
127
|
+
ok 4 - should be equal
|
|
128
|
+
ok 21 - Should emit warning if the schema body is undefined # time=1.682ms
|
|
129
|
+
|
|
130
|
+
# Subtest: Should emit warning if the schema query is undefined
|
|
131
|
+
1..4
|
|
132
|
+
ok 1 - should be equal
|
|
133
|
+
ok 2 - should be equal
|
|
134
|
+
ok 3 - should not error
|
|
135
|
+
ok 4 - should be equal
|
|
136
|
+
ok 22 - Should emit warning if the schema query is undefined # time=1.981ms
|
|
137
|
+
|
|
138
|
+
# Subtest: Should emit warning if the schema params is undefined
|
|
139
|
+
1..4
|
|
140
|
+
ok 1 - should be equal
|
|
141
|
+
ok 2 - should be equal
|
|
142
|
+
ok 3 - should not error
|
|
143
|
+
ok 4 - should be equal
|
|
144
|
+
ok 23 - Should emit warning if the schema params is undefined # time=2.825ms
|
|
145
|
+
|
|
146
|
+
# Subtest: Should emit a warning for every route with undefined schema
|
|
147
|
+
1..16
|
|
148
|
+
ok 1 - should be equal
|
|
149
|
+
ok 2 - should be equal
|
|
150
|
+
ok 3 - should be equal
|
|
151
|
+
ok 4 - should be equal
|
|
152
|
+
ok 5 - should be equal
|
|
153
|
+
ok 6 - should be equal
|
|
154
|
+
ok 7 - should be equal
|
|
155
|
+
ok 8 - should be equal
|
|
156
|
+
ok 9 - should be equal
|
|
157
|
+
ok 10 - should be equal
|
|
158
|
+
ok 11 - should be equal
|
|
159
|
+
ok 12 - should be equal
|
|
160
|
+
ok 13 - should not error
|
|
161
|
+
ok 14 - should be equal
|
|
162
|
+
ok 15 - should not error
|
|
163
|
+
ok 16 - should be equal
|
|
164
|
+
ok 24 - Should emit a warning for every route with undefined schema # time=10.619ms
|
|
165
|
+
|
|
166
|
+
# Subtest: First level $ref
|
|
167
|
+
1..2
|
|
168
|
+
ok 1 - should not error
|
|
169
|
+
ok 2 - should be equivalent
|
|
170
|
+
ok 25 - First level $ref # time=9.493ms
|
|
171
|
+
|
|
172
|
+
# Subtest: Customize validator compiler in instance and route
|
|
173
|
+
1..28
|
|
174
|
+
ok 1 - should be equal
|
|
175
|
+
ok 2 - should be equal
|
|
176
|
+
ok 3 - headers evaluated
|
|
177
|
+
ok 4 - should be equal
|
|
178
|
+
ok 5 - should be equal
|
|
179
|
+
ok 6 - body evaluated
|
|
180
|
+
ok 7 - should be equal
|
|
181
|
+
ok 8 - should be equal
|
|
182
|
+
ok 9 - querystring evaluated
|
|
183
|
+
ok 10 - should be equal
|
|
184
|
+
ok 11 - should be equal
|
|
185
|
+
ok 12 - params evaluated
|
|
186
|
+
ok 13 - should be equal
|
|
187
|
+
ok 14 - should be equal
|
|
188
|
+
ok 15 - should be equal
|
|
189
|
+
ok 16 - should be equal
|
|
190
|
+
ok 17 - should be equal
|
|
191
|
+
ok 18 - should be equal
|
|
192
|
+
ok 19 - should not error
|
|
193
|
+
ok 20 - should be equal
|
|
194
|
+
ok 21 - should be equivalent
|
|
195
|
+
ok 22 - should be equivalent
|
|
196
|
+
ok 23 - should be equivalent
|
|
197
|
+
ok 24 - should be equivalent
|
|
198
|
+
ok 25 - should match pattern
|
|
199
|
+
ok 26 - should not error
|
|
200
|
+
ok 27 - should be equal
|
|
201
|
+
ok 28 - should be equivalent
|
|
202
|
+
ok 26 - Customize validator compiler in instance and route # time=7.242ms
|
|
203
|
+
|
|
204
|
+
# Subtest: Use the same schema across multiple routes
|
|
205
|
+
1..4
|
|
206
|
+
ok 1 - should not error
|
|
207
|
+
ok 2 - should be equal
|
|
208
|
+
ok 3 - should not error
|
|
209
|
+
ok 4 - should be equal
|
|
210
|
+
ok 27 - Use the same schema across multiple routes # time=11.051ms
|
|
211
|
+
|
|
212
|
+
# Subtest: Encapsulation should intervene
|
|
213
|
+
1..2
|
|
214
|
+
ok 1 - should be equal
|
|
215
|
+
ok 2 - should be equal
|
|
216
|
+
ok 28 - Encapsulation should intervene # time=7.551ms
|
|
217
|
+
|
|
218
|
+
# Subtest: Encapsulation isolation
|
|
219
|
+
1..1
|
|
220
|
+
ok 1 - should not error
|
|
221
|
+
ok 29 - Encapsulation isolation # time=11.066ms
|
|
222
|
+
|
|
223
|
+
# Subtest: Add schema after register
|
|
224
|
+
1..5
|
|
225
|
+
ok 1 - should be equal
|
|
226
|
+
ok 2 - should be equal
|
|
227
|
+
ok 3 - should not error
|
|
228
|
+
ok 4 - should be equal
|
|
229
|
+
ok 5 - should be equivalent
|
|
230
|
+
ok 30 - Add schema after register # time=12.987ms
|
|
231
|
+
|
|
232
|
+
# Subtest: Encapsulation isolation for getSchemas
|
|
233
|
+
1..5
|
|
234
|
+
ok 1 - should not error
|
|
235
|
+
ok 2 - should be equivalent
|
|
236
|
+
ok 3 - should be equivalent
|
|
237
|
+
ok 4 - should be equivalent
|
|
238
|
+
ok 5 - should be equivalent
|
|
239
|
+
ok 31 - Encapsulation isolation for getSchemas # time=2.258ms
|
|
240
|
+
|
|
241
|
+
# Subtest: Use the same schema id in different places
|
|
242
|
+
1..1
|
|
243
|
+
ok 1 - should not error
|
|
244
|
+
ok 32 - Use the same schema id in different places # time=11.535ms
|
|
245
|
+
|
|
246
|
+
# Subtest: Get schema anyway should not add `properties` if allOf is present
|
|
247
|
+
1..1
|
|
248
|
+
ok 1 - should not error
|
|
249
|
+
ok 33 - Get schema anyway should not add `properties` if allOf is present # time=23.294ms
|
|
250
|
+
|
|
251
|
+
# Subtest: Get schema anyway should not add `properties` if oneOf is present
|
|
252
|
+
1..1
|
|
253
|
+
ok 1 - should not error
|
|
254
|
+
ok 34 - Get schema anyway should not add `properties` if oneOf is present # time=39.934ms
|
|
255
|
+
|
|
256
|
+
# Subtest: Get schema anyway should not add `properties` if anyOf is present
|
|
257
|
+
1..1
|
|
258
|
+
ok 1 - should not error
|
|
259
|
+
ok 35 - Get schema anyway should not add `properties` if anyOf is present # time=11.178ms
|
|
260
|
+
|
|
261
|
+
# Subtest: Shared schema should be ignored in string enum
|
|
262
|
+
1..2
|
|
263
|
+
ok 1 - should not error
|
|
264
|
+
ok 2 - should be equivalent
|
|
265
|
+
ok 36 - Shared schema should be ignored in string enum # time=19.395ms
|
|
266
|
+
|
|
267
|
+
# Subtest: Shared schema should NOT be ignored in != string enum
|
|
268
|
+
1..2
|
|
269
|
+
ok 1 - should not error
|
|
270
|
+
ok 2 - should be equivalent
|
|
271
|
+
ok 37 - Shared schema should NOT be ignored in != string enum # time=8.455ms
|
|
272
|
+
|
|
273
|
+
# Subtest: Case insensitive header validation
|
|
274
|
+
1..2
|
|
275
|
+
ok 1 - should not error
|
|
276
|
+
ok 2 - should be equal
|
|
277
|
+
ok 38 - Case insensitive header validation # time=12.5ms
|
|
278
|
+
|
|
279
|
+
# Subtest: Not evaluate json-schema $schema keyword
|
|
280
|
+
1..2
|
|
281
|
+
ok 1 - should not error
|
|
282
|
+
ok 2 - should be equivalent
|
|
283
|
+
ok 39 - Not evaluate json-schema $schema keyword # time=8.042ms
|
|
284
|
+
|
|
285
|
+
# Subtest: Validation context in validation result
|
|
286
|
+
1..5
|
|
287
|
+
ok 1 - should be equal
|
|
288
|
+
ok 2 - detailed errors
|
|
289
|
+
ok 3 - should be equal
|
|
290
|
+
ok 4 - should not error
|
|
291
|
+
ok 5 - should be equal
|
|
292
|
+
ok 40 - Validation context in validation result # time=6.908ms
|
|
293
|
+
|
|
294
|
+
# Subtest: The schema build should not modify the input
|
|
295
|
+
1..3
|
|
296
|
+
ok 1 - should be equal
|
|
297
|
+
ok 2 - should not error
|
|
298
|
+
ok 3 - should be equal
|
|
299
|
+
ok 41 - The schema build should not modify the input # time=7.925ms
|
|
300
|
+
|
|
301
|
+
# Subtest: Cross schema reference with encapsulation references
|
|
302
|
+
1..1
|
|
303
|
+
ok 1 - should not error
|
|
304
|
+
ok 42 - Cross schema reference with encapsulation references # time=20.029ms
|
|
305
|
+
|
|
306
|
+
# Subtest: Check how many AJV instances are built \#1
|
|
307
|
+
1..12
|
|
308
|
+
ok 1 - validator not initialized
|
|
309
|
+
ok 2 - validator not initialized
|
|
310
|
+
ok 3 - validator not initialized
|
|
311
|
+
ok 4 - validator not initialized
|
|
312
|
+
ok 5 - should not error
|
|
313
|
+
ok 6 - validator initialized on preReady
|
|
314
|
+
ok 7 - validator initialized on preReady
|
|
315
|
+
ok 8 - validator is only one for all the instances
|
|
316
|
+
ok 9 - validator initialized on preReady
|
|
317
|
+
ok 10 - validator is only one for all the instances
|
|
318
|
+
ok 11 - validator initialized on preReady
|
|
319
|
+
ok 12 - validator is only one for all the instances
|
|
320
|
+
ok 43 - Check how many AJV instances are built \#1 # time=10.185ms
|
|
321
|
+
|
|
322
|
+
# Subtest: onReady hook has the compilers ready
|
|
323
|
+
1..6
|
|
324
|
+
ok 1 - should be equal
|
|
325
|
+
ok 2 - should be equal
|
|
326
|
+
ok 3 - should be equal
|
|
327
|
+
ok 4 - should be equal
|
|
328
|
+
ok 5 - should not error
|
|
329
|
+
ok 6 - it is called once
|
|
330
|
+
ok 44 - onReady hook has the compilers ready # time=7.32ms
|
|
331
|
+
|
|
332
|
+
# Subtest: Check how many AJV instances are built \#2 - verify validatorPool
|
|
333
|
+
1..13
|
|
334
|
+
ok 1 - validator not initialized
|
|
335
|
+
ok 2 - validator not initialized
|
|
336
|
+
ok 3 - validator not initialized
|
|
337
|
+
ok 4 - validator not initialized
|
|
338
|
+
ok 5 - validator not initialized
|
|
339
|
+
ok 6 - validator not initialized
|
|
340
|
+
ok 7 - validator not initialized
|
|
341
|
+
ok 8 - validator is initialized
|
|
342
|
+
ok 9 - this context must share the validator with the same schemas
|
|
343
|
+
ok 10 - this context must share the validator of the parent
|
|
344
|
+
ok 11 - validator is initialized
|
|
345
|
+
ok 12 - this context has its own compiler
|
|
346
|
+
ok 13 - should not error
|
|
347
|
+
ok 45 - Check how many AJV instances are built \#2 - verify validatorPool # time=13.086ms
|
|
348
|
+
|
|
349
|
+
# Subtest: Add schema order should not break the startup
|
|
350
|
+
1..1
|
|
351
|
+
ok 1 - should not error
|
|
352
|
+
ok 46 - Add schema order should not break the startup # time=7.093ms
|
|
353
|
+
|
|
354
|
+
# Subtest: The schema compiler recreate itself if needed
|
|
355
|
+
1..1
|
|
356
|
+
ok 1 - should not error
|
|
357
|
+
ok 47 - The schema compiler recreate itself if needed # time=6.582ms
|
|
358
|
+
|
|
359
|
+
# Subtest: Schema controller setter
|
|
360
|
+
1..2
|
|
361
|
+
ok 1 - allow empty object
|
|
362
|
+
ok 2 - should be equal
|
|
363
|
+
ok 48 - Schema controller setter # time=0.567ms
|
|
364
|
+
|
|
365
|
+
# Subtest: Schema controller bucket
|
|
366
|
+
1..10
|
|
367
|
+
ok 1 - should be equivalent
|
|
368
|
+
ok 2 - should be equivalent
|
|
369
|
+
ok 3 - should be equivalent
|
|
370
|
+
ok 4 - should be equivalent
|
|
371
|
+
ok 5 - should be equal
|
|
372
|
+
ok 6 - should be equal
|
|
373
|
+
ok 7 - should be equal
|
|
374
|
+
ok 8 - should not error
|
|
375
|
+
ok 9 - three schema added
|
|
376
|
+
ok 10 - one bucket built for every register call + 1 for the root instance
|
|
377
|
+
ok 49 - Schema controller bucket # time=1.921ms
|
|
378
|
+
|
|
379
|
+
# Subtest: setSchemaController per instance
|
|
380
|
+
1..7
|
|
381
|
+
ok 1 - instance1 has created the bucket
|
|
382
|
+
ok 2 - instance2 has created the bucket
|
|
383
|
+
ok 3 - add is called
|
|
384
|
+
ok 4 - getSchemas is called
|
|
385
|
+
ok 5 - getSchema is called
|
|
386
|
+
ok 6 - the schema are loaded
|
|
387
|
+
ok 7 - should not error
|
|
388
|
+
ok 50 - setSchemaController per instance # time=1.558ms
|
|
389
|
+
|
|
390
|
+
# Subtest: setSchemaController: Inherits correctly parent schemas with a customized validator instance
|
|
391
|
+
1..5
|
|
392
|
+
ok 1 - Contains same number of schemas
|
|
393
|
+
ok 2 - Contains expected schemas
|
|
394
|
+
ok 3 - should be equal
|
|
395
|
+
ok 4 - should be equal
|
|
396
|
+
ok 5 - Should not coerce the string into array
|
|
397
|
+
ok 51 - setSchemaController: Inherits correctly parent schemas with a customized validator instance # time=30.038ms
|
|
398
|
+
|
|
399
|
+
# Subtest: setSchemaController: Inherits buildSerializer from parent if not present within the instance
|
|
400
|
+
1..6
|
|
401
|
+
ok 1 - should be equal
|
|
402
|
+
ok 2 - should be equal
|
|
403
|
+
ok 3 - Should be called from the child
|
|
404
|
+
ok 4 - Should not be called from the child
|
|
405
|
+
ok 5 - Should be called from the child
|
|
406
|
+
ok 6 - Should not coerce the string into array
|
|
407
|
+
ok 52 - setSchemaController: Inherits buildSerializer from parent if not present within the instance # time=6.538ms
|
|
408
|
+
|
|
409
|
+
# Subtest: setSchemaController: Inherits buildValidator from parent if not present within the instance
|
|
410
|
+
1..6
|
|
411
|
+
ok 1 - should be equal
|
|
412
|
+
ok 2 - should be equal
|
|
413
|
+
ok 3 - Should be called from the child
|
|
414
|
+
ok 4 - Should not be called from the child
|
|
415
|
+
ok 5 - Should be called from the child
|
|
416
|
+
ok 6 - Should not coerce the string into array
|
|
417
|
+
ok 53 - setSchemaController: Inherits buildValidator from parent if not present within the instance # time=6.44ms
|
|
418
|
+
|
|
419
|
+
# Subtest: Should throw if not default validator passed
|
|
420
|
+
1..4
|
|
421
|
+
ok 1 - should be equal
|
|
422
|
+
ok 2 - should be equivalent
|
|
423
|
+
ok 3 - should be equal
|
|
424
|
+
ok 4 - Should not coerce the string into array
|
|
425
|
+
ok 54 - Should throw if not default validator passed # time=6.941ms
|
|
426
|
+
|
|
427
|
+
# Subtest: Should coerce the array if the default validator is used
|
|
428
|
+
1..2
|
|
429
|
+
ok 1 - should be equal
|
|
430
|
+
ok 2 - Should coerce the string into array
|
|
431
|
+
ok 55 - Should coerce the array if the default validator is used # time=8.457ms
|
|
432
|
+
|
|
433
|
+
# Subtest: Should return a human-friendly error if response status codes are not specified
|
|
434
|
+
1..2
|
|
435
|
+
ok 1 - should be equal
|
|
436
|
+
ok 2 - should match pattern
|
|
437
|
+
ok 56 - Should return a human-friendly error if response status codes are not specified # time=1.034ms
|
|
438
|
+
|
|
439
|
+
# Subtest: setSchemaController: custom validator instance should not mutate headers schema
|
|
440
|
+
1..2
|
|
441
|
+
ok 1 - type is Headers
|
|
442
|
+
ok 2 - type is Headers
|
|
443
|
+
ok 57 - setSchemaController: custom validator instance should not mutate headers schema # time=1.048ms
|
|
444
|
+
|
|
445
|
+
1..57
|