Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate using aot false by default, 182 tests fail #773

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

remorses
Copy link

@remorses remorses commented Aug 10, 2024

related to #770

Tests for websocket and trace had to be disabled because they would hang forever

682 pass
26 skip
186 fail

This is the test output log
bun test v1.1.21 (70ca2b76)

test/tracer/timing.test.ts:
22 | 				return 'a'
23 | 			})
24 | 
25 | 		const { headers } = await app.handle(req('/'))
26 | 
27 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                           ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:27:39
(fail) Trace Timing > handle [20.53ms]
41 | 			})
42 | 			.get('/', () => 'a')
43 | 
44 | 		const { headers } = await app.handle(req('/'))
45 | 
46 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                           ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:46:39
(fail) Trace Timing > request [12.68ms]
60 | 			})
61 | 			.post('/', ({ body }) => 'a')
62 | 
63 | 		const { headers } = await app.handle(post('/', {}))
64 | 
65 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                           ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:65:39
(fail) Trace Timing > parse [12.36ms]
79 | 			})
80 | 			.get('/', () => 'a')
81 | 
82 | 		const { headers } = await app.handle(req('/'))
83 | 
84 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                           ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:84:39
(fail) Trace Timing > transform [11.21ms]
 98 | 			})
 99 | 			.get('/', () => 'a')
100 | 
101 | 		const { headers } = await app.handle(req('/'))
102 | 
103 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:103:39
(fail) Trace Timing > beforeHandle [11.78ms]
117 | 			})
118 | 			.get('/', () => 'a')
119 | 
120 | 		const { headers } = await app.handle(req('/'))
121 | 
122 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:122:39
(fail) Trace Timing > afterHandle [10.76ms]
136 | 			})
137 | 			.get('/', () => 'a')
138 | 
139 | 		const { headers } = await app.handle(req('/'))
140 | 
141 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:141:39
(fail) Trace Timing > mapResponse [0.15ms]
(pass) Trace Timing > afterResponse [0.78ms]
173 | 				}
174 | 			})
175 | 
176 | 		const { headers } = await app.handle(post('/', {}))
177 | 
178 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:178:39
(fail) Trace Timing > inline parse [11.09ms]
193 | 				}
194 | 			})
195 | 
196 | 		const { headers } = await app.handle(req('/'))
197 | 
198 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:198:39
(fail) Trace Timing > inline transform [10.93ms]
213 | 				}
214 | 			})
215 | 
216 | 		const { headers } = await app.handle(req('/'))
217 | 
218 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:218:39
(fail) Trace Timing > inline beforeHandle [11.61ms]
233 | 				}
234 | 			})
235 | 
236 | 		const { headers } = await app.handle(req('/'))
237 | 
238 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:238:39
(fail) Trace Timing > inline afterHandle [11.33ms]
253 | 				}
254 | 			})
255 | 
256 | 		const { headers } = await app.handle(req('/'))
257 | 
258 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:258:39
(fail) Trace Timing > inline mapResponse [0.42ms]
(pass) Trace Timing > inline afterResponse [0.04ms]
304 | 				]
305 | 			})
306 | 
307 | 		const { headers } = await app.handle(post('/', {}))
308 | 
309 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:309:39
(fail) Trace Timing > parse unit [13.08ms]
337 | 				]
338 | 			})
339 | 
340 | 		const { headers } = await app.handle(req('/'))
341 | 
342 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:342:39
(fail) Trace Timing > transform unit [14.84ms]
370 | 				]
371 | 			})
372 | 
373 | 		const { headers } = await app.handle(req('/'))
374 | 
375 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:375:39
(fail) Trace Timing > beforeHandle unit [14.36ms]
403 | 				]
404 | 			})
405 | 
406 | 		const { headers } = await app.handle(req('/'))
407 | 
408 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:408:39
(fail) Trace Timing > beforeHandle units [14.35ms]
436 | 				]
437 | 			})
438 | 
439 | 		const { headers } = await app.handle(req('/'))
440 | 
441 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:441:39
(fail) Trace Timing > afterHandle unit [13.37ms]
469 | 				]
470 | 			})
471 | 
472 | 		const { headers } = await app.handle(req('/'))
473 | 
474 | 		expect(+(headers.get('time') ?? 0)).toBeGreaterThan(5)
                                            ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 5
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/timing.test.ts:474:39
(fail) Trace Timing > mapResponse unit [0.27ms]
(pass) Trace Timing > afterResponse unit [0.21ms]

test/tracer/trace.test.ts:
(skip) trace > inherits plugin
(skip) trace > handle scoped instance
(skip) trace > call all trace
(skip) trace > don't crash on composer
(skip) trace > handle local scope
(skip) trace > handle scoped scope
(skip) trace > handle global scope
(skip) trace > handle propagate
(skip) trace > deduplicate plugin when name is provided
(skip) trace > report error thrown in lifecycle event
(skip) trace > report error return in lifecycle event
(skip) trace > report error to parent group
(skip) trace > report resolve parent error
(skip) trace > report error return in lifecycle event
(skip) trace > report error throw in handle
(skip) trace > report error return in handle
(skip) trace > report error throw in handle

test/tracer/detail.test.ts:
23 | 				parse: [function kindred() {}]
24 | 			})
25 | 
26 | 		const { headers } = await app.handle(post('/', {}))
27 | 
28 | 		expect(headers.get('name')).toBe('luna, kindred')
                                   ^
error: expect(received).toBe(expected)

Expected: "luna, kindred"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/tracer/detail.test.ts:28:31
(fail) Trace Detail > report parse units name [1.03ms]
48 | 				transform: [function kindred() {}]
49 | 			})
50 | 
51 | 		const { headers } = await app.handle(req('/'))
52 | 
53 | 		expect(headers.get('name')).toBe('luna, kindred')
                                   ^
error: expect(received).toBe(expected)

Expected: "luna, kindred"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/tracer/detail.test.ts:53:31
(fail) Trace Detail > report transform units name [0.50ms]
73 | 				beforeHandle: [function kindred() {}]
74 | 			})
75 | 
76 | 		const { headers } = await app.handle(req('/'))
77 | 
78 | 		expect(headers.get('name')).toBe('luna, kindred')
                                   ^
error: expect(received).toBe(expected)

Expected: "luna, kindred"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/tracer/detail.test.ts:78:31
(fail) Trace Detail > report beforeHandle units name [0.29ms]
 98 | 				afterHandle: [function kindred() {}]
 99 | 			})
100 | 
101 | 		const { headers } = await app.handle(req('/'))
102 | 
103 | 		expect(headers.get('name')).toBe('luna, kindred')
                                    ^
error: expect(received).toBe(expected)

Expected: "luna, kindred"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/tracer/detail.test.ts:103:31
(fail) Trace Detail > report afterHandle units name [0.26ms]
123 | 				mapResponse: [function kindred() {}]
124 | 			})
125 | 
126 | 		const { headers } = await app.handle(req('/'))
127 | 
128 | 		expect(headers.get('name')).toBe('luna, kindred')
                                    ^
error: expect(received).toBe(expected)

Expected: "luna, kindred"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/tracer/detail.test.ts:128:31
(fail) Trace Detail > report mapResponse units name [0.15ms]
(pass) Trace Detail > report afterResponse units name [0.12ms]

test/tracer/aot.test.ts:
(pass) Trace AoT > try-catch edge case [1.22ms]
62 | 		await Promise.all([
63 | 			app.handle(req('/plugin')),
64 | 			app.handle(req('/main'))
65 | 		])
66 | 
67 | 		expect(called).toBe(1)
                      ^
error: expect(received).toBe(expected)

Expected: 1
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/tracer/aot.test.ts:67:18
(fail) Trace AoT > handle scope [1.56ms]

test/sucrose/query.test.ts:
(pass) Query > access all using property name [0.60ms]
(pass) Query > access all using destructuring [0.20ms]
(pass) Query > access single param using property name [0.09ms]
(pass) Query > access single param using destructuring [0.14ms]
(pass) Query > access all using destructuring assignment [0.11ms]
(pass) Query > access all using destructuring assignment within derive [1.03ms]
(pass) Query > access all using property name within derive [0.10ms]
(pass) Query > destructured encoded & (%26) query string [0.35ms]

test/sucrose/extract-main-parameter.test.ts:
(pass) extract main parameter > extract main parameter when there is no spread operator and only one parameter [0.06ms]
(pass) extract main parameter > extract main parameter when there is a spread operator and only one parameter
(pass) extract main parameter > extract main parameter when there are multiple parameters and a spread operator [0.04ms]
(pass) extract main parameter > return undefined when parameter is an empty string [0.38ms]
(pass) extract main parameter > return undefined when parameter is undefined [0.01ms]
(pass) extract main parameter > return undefined when parameter is null

test/sucrose/sucrose.test.ts:
(pass) sucrose > common 1 [0.10ms]
(pass) sucrose > common 2 [0.03ms]
(pass) sucrose > integration 1 [0.36ms]
(pass) sucrose > inherits inference from plugin [0.09ms]
(pass) sucrose > don't link inference [0.15ms]
(pass) sucrose > mix up chain properties as query [0.02ms]
(pass) sucrose > infer all inferences if context is passed to function [0.05ms]
(pass) sucrose > infer all inferences if context is passed to function [0.03ms]
(pass) sucrose > infer single object destructure property [0.02ms]

test/sucrose/remove-default-parameter.test.ts:
(pass) removeDefaultParameter > should remove default parameter values from a string parameter [0.54ms]
(pass) removeDefaultParameter > should return the modified string parameter [0.01ms]
(pass) removeDefaultParameter > should handle a string parameter with no default parameter values
(pass) removeDefaultParameter > should handle a string parameter with no equals sign
(pass) removeDefaultParameter > should handle a string parameter with an equals sign but no comma or closing bracket
(pass) removeDefaultParameter > should handle a string parameter with an equals sign and a comma but no closing bracket
(pass) removeDefaultParameter > should remove default parameter values from a string parameter
(pass) removeDefaultParameter > should remove default parameter values from a string parameter [0.02ms]
(pass) removeDefaultParameter > should remove default parameter values from a string parameter [0.01ms]
(pass) removeDefaultParameter > should remove default parameter values from a string parameter [0.01ms]
(pass) removeDefaultParameter > should remove default parameter values from a string parameter when there is an equals sign and a closing bracket but no comma
(pass) removeDefaultParameter > should remove default parameter values from a string parameter
(pass) removeDefaultParameter > should not remove default parameter values with different capitalization [0.01ms]
(pass) removeDefaultParameter > should remove default parameter values from a string parameter
(pass) removeDefaultParameter > should remove default parameter values when there are whitespace characters around the equals sign
(pass) removeDefaultParameter > should remove default parameter values from a string parameter
(pass) removeDefaultParameter > should remove default parameter values from a string parameter

test/sucrose/find-alias.test.ts:
(pass) find alias > find aliases of a variable in a simple function body
(pass) find alias > find aliases of a variable in a function body with multiple assignments [0.02ms]
(pass) find alias > find aliases of a variable in a function body with object destructuring as-is
(pass) find alias > return an empty array when the variable is not found in the function body
(pass) find alias > handle a function body with no content [0.01ms]
(pass) find alias > handle a function body with only one line [0.01ms]
(pass) find alias > find aliases of a variable in a nested function body [0.02ms]
(pass) find alias > find aliases of a variable in a function body with comments [0.02ms]
(pass) find alias > find aliases of a variable in a function body with multiple lines [0.02ms]
(pass) find alias > find aliases of a variable in a nested function body [0.03ms]
(pass) find alias > find aliases of a variable in a function body with mixed quotes [0.02ms]
(pass) find alias > handle aliases of a variable in a function body with mixed spaces and tabs [0.02ms]
(pass) find alias > find aliases of a variable in a simple function body [0.02ms]
(pass) find alias > find aliases of a variable in a simple function body [0.02ms]
(pass) find alias > find aliases of a variable in a function body with a variable name that starts with an underscore [0.02ms]
(pass) find alias > find aliases of a variable in a function body with a variable name that starts with a number [0.02ms]
(pass) find alias > find aliases of a variable in a function body with a variable name that contains a dot
(pass) find alias > find aliases of a variable in a function body with a hyphenated variable name
(pass) find alias > find aliases of a variable in a function body with a variable name that contains a dollar sign

test/sucrose/infer-body-reference.test.ts:
(pass) infer body reference > infer dot notation
(pass) infer body reference > infer property access [0.03ms]
(pass) infer body reference > infer multiple query [0.04ms]
(pass) infer body reference > skip dynamic quote query [0.02ms]
(pass) infer body reference > infer dot notation [0.02ms]

test/sucrose/retrieve-root-parameters.test.ts:
(pass) retrieve root parameter > return an empty string when given an empty string [0.14ms]
(pass) retrieve root parameter > remove brackets and their contents when they are at the root level [0.02ms]
(pass) retrieve root parameter > return an empty string when given only brackets [0.01ms]
(pass) retrieve root parameter > return an empty string when given only one bracket
(pass) retrieve root parameter > return the root parameters when given a string with spaces between brackets [0.02ms]
(pass) retrieve root parameter > return parameter on minified bracket
(pass) retrieve root parameter > handle tab and new line
(pass) retrieve root parameter > handle last parameter destructuring [0.02ms]

test/sucrose/bracket-pair-range-reverse.test.ts:
(pass) bracket pair range reverse > return the correct range when given a string with a single bracket pair
(pass) bracket pair range reverse > return the correct range when given a string with nested bracket pairs
(pass) bracket pair range reverse > return [-1, 0] when given a string without any bracket pairs [0.02ms]
(pass) bracket pair range reverse > return [0, 1] when given a string with a single opening bracket at the beginning
(pass) bracket pair range reverse > return [parameter.length - 1, parameter.length] when given a string with a single closing bracket at the end
(pass) bracket pair range reverse > return [-1, 0] when given an empty string
(pass) bracket pair range reverse > return the correct range when given a string with multiple bracket pairs
(pass) bracket pair range reverse > return the correct range when given a string with an opening bracket but no closing bracket
(pass) bracket pair range reverse > return the correct range when given a string with brackets inside quotes
(pass) bracket pair range reverse > return the correct range when given a string with nested bracket pairs
(pass) bracket pair range reverse > return the correct range when given a string with non-bracket characters

test/sucrose/remove-colon-alias.test.ts:
(pass) remove colon alias > remove aliased name [0.04ms]
(pass) remove colon alias > remove aliased with part of keyword
(pass) remove colon alias > remove multiple aliased [0.02ms]
(pass) remove colon alias > maintain same value if no aliased found

test/sucrose/separate-function.test.ts:
(pass) Sucrose: separateFunction > separate arrowParam [0.67ms]
(pass) Sucrose: separateFunction > separate arrowNoParam [0.03ms]
(pass) Sucrose: separateFunction > separate arrowAsync
(pass) Sucrose: separateFunction > separate fnParam
(pass) Sucrose: separateFunction > separate fnNoParam
(pass) Sucrose: separateFunction > separate fnAsync
(pass) Sucrose: separateFunction > separate minifed arrow param
(pass) Sucrose: separateFunction > separate minified arrow without whitespace in the beginning

test/sucrose/bracket-pair-range.test.ts:
(pass) bracket pair range > return the correct range when given a string with a single bracket pair [0.17ms]
(pass) bracket pair range > return the correct range when given a string with nested bracket pairs
(pass) bracket pair range > return [-1, 0] when given a string without any bracket pairs [0.02ms]
(pass) bracket pair range > return [0, 1] when given a string with a single opening bracket at the beginning
(pass) bracket pair range > return [parameter.length - 1, parameter.length] when given a string with a single closing bracket at the end
(pass) bracket pair range > return [-1, 0] when given an empty string
(pass) bracket pair range > return the correct range when given a string with multiple bracket pairs
(pass) bracket pair range > return the correct range when given a string with an opening bracket but no closing bracket
(pass) bracket pair range > return the correct range when given a string with brackets inside quotes
(pass) bracket pair range > return the correct range when given a string with nested bracket pairs
(pass) bracket pair range > return the correct range when given a string with non-bracket characters

test/extends/store.test.ts:
(pass) State > decorate primitive
(pass) State > decorate multiple [0.03ms]
(pass) State > decorate object [0.02ms]
(pass) State > remap object [0.02ms]
(pass) State > inherits functional plugin [0.02ms]
(pass) State > inherits instance plugin [0.16ms]
(pass) State > accepts any type [0.02ms]
(pass) State > remap [0.02ms]
(pass) State > handle class deduplication [0.06ms]
(pass) State > handle nested object deduplication [0.02ms]
(pass) State > override primitive [0.02ms]
(pass) State > override object [0.02ms]
(pass) State > override handle class [0.03ms]
(pass) State > override nested object deduplication using name [0.02ms]
(pass) State > override nested object deduplication using value [0.02ms]

test/extends/decorators.test.ts:
(pass) Decorate > decorate primitive [0.08ms]
(pass) Decorate > decorate multiple [0.03ms]
(pass) Decorate > decorate object [0.02ms]
(pass) Decorate > remap object [0.02ms]
(pass) Decorate > inherits functional plugin [0.10ms]
(pass) Decorate > inherits instance plugin [0.11ms]
(pass) Decorate > accepts any type [0.02ms]
(pass) Decorate > remap [0.02ms]
(pass) Decorate > handle class deduplication [0.02ms]
(pass) Decorate > handle nested object deduplication [0.02ms]
(pass) Decorate > override primitive [0.02ms]
(pass) Decorate > override object [0.02ms]
(pass) Decorate > override handle class [0.02ms]
(pass) Decorate > override nested object deduplication using name [0.02ms]
(pass) Decorate > override nested object deduplication using value [0.02ms]

test/extends/models.test.ts:
SyntaxError: Failed to parse JSON
(fail) Model > add single [1.89ms]
SyntaxError: Failed to parse JSON
(fail) Model > add multiple [0.03ms]
SyntaxError: Failed to parse JSON
(fail) Model > add object [0.22ms]
SyntaxError: Failed to parse JSON
(fail) Model > add object [0.06ms]
SyntaxError: Failed to parse JSON
(fail) Model > inherits functional plugin [0.20ms]
SyntaxError: Failed to parse JSON
(fail) Model > inherits instance plugin [0.03ms]
(pass) Model > inherits instance plugin [0.19ms]
(pass) Model > validate reference model [1.99ms]
SyntaxError: Failed to parse JSON
(fail) Model > remap [0.49ms]

test/extends/error.test.ts:
(pass) Error > add single [0.02ms]
(pass) Error > add multiple [0.06ms]
(pass) Error > add object [0.03ms]
(pass) Error > inherits functional plugin [0.03ms]
(pass) Error > inherits instance plugin [0.06ms]
(pass) Error > preserve status code base on error if not set [0.03ms]
86 | 		})
87 | 
88 | 		const response = await app.handle(req('/'))
89 | 
90 | 		expect(response.status).toBe(422)
91 | 		expect(response.headers.get('content-type')).toBe('application/json')
                                                    ^
error: expect(received).toBe(expected)

Expected: "application/json"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/extends/error.test.ts:91:48
(fail) Error > validation error should be application/json [0.31ms]

test/hoc/index.test.ts:
15 | 			})
16 | 			.get('/', () => 'ok')
17 | 
18 | 		await app.handle(req('/'))
19 | 
20 | 		expect(called).toBe(1)
                      ^
error: expect(received).toBe(expected)

Expected: 1
Received: 0

      at /Users/morse/Documents/GitHub/elysia/test/hoc/index.test.ts:20:18
(fail) HOC > work [0.82ms]
(pass) HOC > deduplicate [0.18ms]

test/core/scoped.test.ts:
It's recommended to use scoped instance with a prefix to prevent collision routing with other instance.
(pass) Scoped > sync store [1.57ms]
It's recommended to use scoped instance with a prefix to prevent collision routing with other instance.
(pass) Scoped > encapsulate request event [0.12ms]
It's recommended to use scoped instance with a prefix to prevent collision routing with other instance.
(pass) Scoped > encapsulate afterhandle event [0.14ms]
(pass) Scoped > Multiple scopes registering all routes [0.14ms]

test/core/mount.test.ts:
(pass) Mount > preserve request URL [0.23ms]
(pass) Mount > preserve request URL with query [0.03ms]

test/core/redirect.test.ts:
(pass) Redirect > handles redirect without explicit status [0.58ms]
(pass) Redirect > handles redirect with explicit status [0.03ms]

test/core/as.test.ts:
(pass) as > plugin [0.26ms]
(pass) as > global [0.12ms]
(pass) as > global on scoped event [0.11ms]
(pass) as > handle as global [0.40ms]
(pass) as > handle as global with local override [0.45ms]
(pass) as > handle as global with scoped override [0.39ms]
(pass) as > handle as plugin [0.27ms]
(pass) as > handle as propagate twice [0.28ms]

test/core/response.test.ts:
(pass) Response > return formdata [22.78ms]
28 | 
29 | 		const contentType = await app
30 | 			.handle(req('/'))
31 | 			.then((x) => x.headers.get('content-type'))
32 | 
33 | 		expect(contentType).toStartWith('multipart/form-data')
                           ^
error: expect(received).toStartWith(expected)

Expected to start with: "multipart/form-data"
Received: "application/json;charset=utf-8"

      at /Users/morse/Documents/GitHub/elysia/test/core/response.test.ts:33:23
(fail) Response > return formdata [0.50ms]

test/core/normalize.test.ts:
19 | 			}
20 | 		)
21 | 
22 | 		const response = await app.handle(req('/')).then((x) => x.json())
23 | 
24 | 		expect(response).toEqual({
                        ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/a",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           hello: {
+             type: "string",
+           },
+         },
+         required: [
+           "hello"
+         ],
+         type: "object",
+       },
+       summary: "Property 'a' should not be provided",
+       type: 42,
+       value: "b",
+     }
+   ],
+   expected: {
+     hello: "",
+   },
+   found: {
+     a: "b",
+     hello: "world",
+   },
+   message: "Unexpected property",
+   on: "response",
+   property: "/a",
+   summary: "Property 'a' should not be provided",
+   type: "validation",
-   hello: "world",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:24:20
(fail) Normalize > normalize response [4.71ms]
44 | 			}
45 | 		)
46 | 
47 | 		const response = await app.handle(req('/')).then((x) => x.json())
48 | 
49 | 		expect(response).toEqual({
                        ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/a",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           hello: {
+             type: "string",
+           },
+         },
+         required: [
+           "hello"
+         ],
+         type: "object",
+       },
+       summary: "Property 'a' should not be provided",
+       type: 42,
+       value: "b",
+     }
+   ],
+   expected: {
+     hello: "",
+   },
+   found: {
+     a: "b",
+     hello: "world",
+   },
+   message: "Unexpected property",
+   on: "response",
+   property: "/a",
+   summary: "Property 'a' should not be provided",
+   type: "validation",
-   hello: "world",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:49:20
(fail) Normalize > normalize optional response [0.41ms]
(pass) Normalize > strictly validate response if not normalize [0.18ms]
SyntaxError: Failed to parse JSON
(fail) Normalize > normalize multiple response [0.10ms]
113 | 			}
114 | 		)
115 | 
116 | 		const response = await app.handle(req('/'))
117 | 
118 | 		expect(response.status).toEqual(422)
                                ^
error: expect(received).toEqual(expected)

Expected: �[32m422�[0m
Received: �[31m500�[0m

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:118:27
(fail) Normalize > strictly validate multiple response [0.28ms]
139 | 			}
140 | 		)
141 | 
142 | 		const response = await app.handle(req('/')).then((x) => x.json())
143 | 
144 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/hifumi",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           hello: {
+             type: "string",
+           },
+         },
+         required: [
+           "hello"
+         ],
+         type: "object",
+       },
+       summary: "Property 'hifumi' should not be provided",
+       type: 42,
+       value: "daisuki",
+     }
+   ],
+   expected: {
+     hello: "",
+   },
+   found: {
+     hello: "Nagisa",
+     hifumi: "daisuki",
+   },
+   message: "Unexpected property",
+   on: "response",
+   property: "/hifumi",
+   summary: "Property 'hifumi' should not be provided",
+   type: "validation",
-   hello: "Nagisa",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:144:20
(fail) Normalize > normalize multiple response using 200 [0.33ms]
(pass) Normalize > strictly validate multiple response using 200 if not normalize [0.15ms]
(pass) Normalize > do not normalize response when allowing additional properties [0.07ms]
213 | 					hifumi: 'daisuki'
214 | 				})
215 | 			)
216 | 			.then((x) => x.json())
217 | 
218 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/hifumi",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'hifumi' should not be provided",
+       type: 42,
+       value: "daisuki",
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     hifumi: "daisuki",
+     name: "nagisa",
+   },
+   message: "Unexpected property",
+   on: "body",
+   property: "/hifumi",
+   summary: "Property 'hifumi' should not be provided",
+   type: "validation",
-   name: "nagisa",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:218:20
(fail) Normalize > normalize body [0.35ms]
236 | 					hifumi: 'daisuki'
237 | 				})
238 | 			)
239 | 			.then((x) => x.json())
240 | 
241 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/hifumi",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'hifumi' should not be provided",
+       type: 42,
+       value: "daisuki",
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     hifumi: "daisuki",
+     name: "nagisa",
+   },
+   message: "Unexpected property",
+   on: "body",
+   property: "/hifumi",
+   summary: "Property 'hifumi' should not be provided",
+   type: "validation",
-   name: "nagisa",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:241:20
(fail) Normalize > normalize optional body [0.31ms]
(pass) Normalize > strictly validate body if not normalize [0.12ms]
(pass) Normalize > loosely validate body if not normalize and has additionalProperties [0.04ms]
303 | 
304 | 		const response = await app
305 | 			.handle(req('/?name=nagisa&hifumi=daisuki'))
306 | 			.then((x) => x.json())
307 | 
308 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/hifumi",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'hifumi' should not be provided",
+       type: 42,
+       value: "daisuki",
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     hifumi: "daisuki",
+     name: "nagisa",
+   },
+   message: "Unexpected property",
+   on: "query",
+   property: "/hifumi",
+   summary: "Property 'hifumi' should not be provided",
+   type: "validation",
-   name: "nagisa",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:308:20
(fail) Normalize > normalize query [2.85ms]
(pass) Normalize > don't normalize query on additionalProperties [0.33ms]
(pass) Normalize > normalize based on property when normalized is disabled [0.21ms]
372 | 					}
373 | 				})
374 | 			)
375 | 			.then((x) => x.json())
376 | 
377 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   name: "nagisa",
  }

- Expected  - 1
+ Received  + 290

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:377:20
(fail) Normalize > normalize headers [1.97ms]
398 | 			req('/', {
399 | 				headers
400 | 			})
401 | 		)
402 | 
403 | 		expect(await res.json()).toEqual(headers)
                                 ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   job: "alchemist",
-   name: "sucrose",
  }

- Expected  - 2
+ Received  + 43

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:403:28
(fail) Normalize > loosely validate headers by default if not normalized [0.30ms]
(pass) Normalize > strictly validate headers if not normalized and additionalProperties is false [0.18ms]
SyntaxError: Failed to parse JSON
(fail) Normalize > normalize response with getter fields on class [0.20ms]
505 | 			}
506 | 		)
507 | 
508 | 		const response = await app.handle(req('/')).then((x) => x.json())
509 | 
510 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/two",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property 'two' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/twoGet",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property 'twoGet' should not be provided",
+       type: 42,
+       value: "world",
+     }
+   ],
+   expected: {
+     one: "",
+     oneGet: "",
+   },
+   found: {
+     one: "world",
+     oneGet: "world",
+     two: "world",
+     twoGet: "world",
+   },
+   message: "Unexpected property",
+   on: "response",
+   property: "/two",
+   summary: "Property 'two' should not be provided",
+   type: "validation",
-   one: "world",
-   oneGet: "world",
  }

- Expected  - 2
+ Received  + 63

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:510:20
(fail) Normalize > normalize response with getter fields on simple object [0.14ms]
550 | 			}
551 | 		)
552 | 
553 | 		const response = await app.handle(req('/')).then((x) => x.json())
554 | 
555 | 		expect(response).toEqual([{
                         ^
error: expect(received).toEqual(expected)

  [
    {
      one: "world",
+     two: "world",
-     oneGet: "world",
    }
  ]

- Expected  - 1
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:555:20
(fail) Normalize > normalize response with getter fields on class array [0.22ms]
586 | 			}
587 | 		)
588 | 
589 | 		const response = await app.handle(req('/')).then((x) => x.json())
590 | 
591 | 		expect(response).toEqual([{
                         ^
error: expect(received).toEqual(expected)

+ {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/0/two",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.two' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/twoGet",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.twoGet' should not be provided",
+       type: 42,
+       value: "world",
+     }
+   ],
+   expected: [],
+   found: [
+     {
+       one: "world",
+       oneGet: "world",
+       two: "world",
+       twoGet: "world",
+     }
+   ],
+   message: "Unexpected property",
+   on: "response",
+   property: "/0/two",
+   summary: "Property '0.two' should not be provided",
+   type: "validation",
+ }
- [
-   {
-     one: "world",
-     oneGet: "world",
-   }
- ]

- Expected  - 6
+ Received  + 64

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:591:20
(fail) Normalize > normalize response with getter fields on simple object array [0.11ms]
674 | 			}
675 | 		)
676 | 
677 | 		const response = await app.handle(req('/')).then((x) => x.json())
678 | 
679 | 		expect(response).toEqual([{
                         ^
error: expect(received).toEqual(expected)

  [
    {
+     four: [
-     one: "world",
-     oneGet: "world",
-     three: [
        {
          one: "world",
+         two: "world",
-         oneGet: "world",
        }
      ],
+     one: "world",
+     three: [
-     threeGet: [
        {
          one: "world",
+         two: "world",
-         oneGet: "world",
        }
      ],
+     two: "world",
    }
  ]

- Expected  - 6
+ Received  + 6

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:679:20
(fail) Normalize > normalize response with getter fields on class array with nested arrays [0.39ms]
750 | 			}
751 | 		)
752 | 
753 | 		const response = await app.handle(req('/')).then((x) => x.json())
754 | 
755 | 		expect(response).toEqual([{
                         ^
error: expect(received).toEqual(expected)

+ {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/0/two",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+           three: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+           threeGet: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+         },
+         required: [
+           "one",
+           "oneGet",
+           "three",
+           "threeGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.two' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/twoGet",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+           three: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+           threeGet: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+         },
+         required: [
+           "one",
+           "oneGet",
+           "three",
+           "threeGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.twoGet' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/four",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+           three: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+           threeGet: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+         },
+         required: [
+           "one",
+           "oneGet",
+           "three",
+           "threeGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.four' should not be provided",
+       type: 42,
+       value: [
+         {
+           one: "world",
+           oneGet: "world",
+           two: "world",
+           twoGet: "world",
+         }
+       ],
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/fourGet",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+           three: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+           threeGet: {
+             items: {
+               additionalProperties: false,
+               properties: {
+                 one: {
+                   type: "string",
+                 },
+                 oneGet: {
+                   type: "string",
+                 },
+               },
+               required: [
+                 "one",
+                 "oneGet"
+               ],
+               type: "object",
+             },
+             type: "array",
+           },
+         },
+         required: [
+           "one",
+           "oneGet",
+           "three",
+           "threeGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.fourGet' should not be provided",
+       type: 42,
+       value: [
+         {
+           one: "world",
+           oneGet: "world",
+           two: "world",
+           twoGet: "world",
+         }
+       ],
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/three/0/two",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.three.0.two' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/three/0/twoGet",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.three.0.twoGet' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/threeGet/0/two",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.threeGet.0.two' should not be provided",
+       type: 42,
+       value: "world",
+     },
+     {
+       message: "Unexpected property",
+       path: "/0/threeGet/0/twoGet",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           one: {
+             type: "string",
+           },
+           oneGet: {
+             type: "string",
+           },
+         },
+         required: [
+           "one",
+           "oneGet"
+         ],
+         type: "object",
+       },
+       summary: "Property '0.threeGet.0.twoGet' should not be provided",
+       type: 42,
+       value: "world",
+     }
+   ],
+   expected: [],
+   found: [
+     {
+       four: [
+         {
+           one: "world",
+           oneGet: "world",
+           two: "world",
+           twoGet: "world",
+         }
+       ],
+       fourGet: [
+         {
+           one: "world",
+           oneGet: "world",
+           two: "world",
+           twoGet: "world",
+         }
+       ],
+       one: "world",
+       oneGet: "world",
+       three: [
+         {
+           one: "world",
+           oneGet: "world",
+           two: "world",
+           twoGet: "world",
+         }
+       ],
+       threeGet: [
+         {
+           one: "world",
+           oneGet: "world",
+           two: "world",
+           twoGet: "world",
+         }
+       ],
+       two: "world",
+       twoGet: "world",
+     }
+   ],
+   message: "Unexpected property",
+   on: "response",
+   property: "/0/two",
+   summary: "Property '0.two' should not be provided",
+   type: "validation",
+ }
- [
-   {
-     one: "world",
-     oneGet: "world",
-     three: [
-       {
-         one: "world",
-         oneGet: "world",
-       }
-     ],
-     threeGet: [
-       {
-         one: "world",
-         oneGet: "world",
-       }
-     ],
-   }
- ]

- Expected  - 18
+ Received  + 408

      at /Users/morse/Documents/GitHub/elysia/test/core/normalize.test.ts:755:20
(fail) Normalize > normalize response with getter fields on simple object array with nested arrays [0.42ms]

test/core/modules.test.ts:
(pass) Modules > inline async [0.36ms]
(pass) Modules > async [0.12ms]
(pass) Modules > inline import [0.08ms]
(pass) Modules > import [0.06ms]
(pass) Modules > import non default [0.05ms]
(pass) Modules > inline import non default [0.02ms]
(pass) Modules > register async and lazy path [0.02ms]
(pass) Modules > count lazy module correctly [0.07ms]
(pass) Modules > handle other routes while lazy load [0.07ms]
(pass) Modules > handle deferred import [0.07ms]
(pass) Modules > re-compile on async plugin [2.24ms]
141 | 		const app = new Elysia().use(a()).get('/', ({ derived }) => derived)
142 | 
143 | 		await app.modules
144 | 
145 | 		const resRoot = await app.handle(req('/')).then((r) => r.text())
146 | 		expect(resRoot).toBe('async')
                        ^
error: expect(received).toBe(expected)

Expected: "async"
Received: ""

      at /Users/morse/Documents/GitHub/elysia/test/core/modules.test.ts:146:19
(fail) Modules > handle async plugin [1.69ms]
(pass) Modules > do not duplicate functional async plugin lifecycle [0.03ms]
(pass) Modules > do not duplicate instance async plugin lifecycle [0.02ms]

test/core/elysia.test.ts:
(pass) Edge Case > handle state
(pass) Edge Case > don't return HTTP 10 [0.45ms]
(pass) Edge Case > has no side-effect [0.10ms]
(pass) Edge Case > return Promise [0.04ms]
(pass) Edge Case > handle dynamic all method [0.08ms]
(pass) Edge Case > handle strict path and loose path [0.35ms]
(pass) Edge Case > return cookie with file [0.91ms]
140 | 			.get('/3', () => '3')
141 | 			.get('/1', () => '-')
142 | 			.get('/4', () => '4')
143 | 
144 | 		// @ts-expect-error
145 | 		expect(app.routeTree.get('GET/0')).toEqual(0)
                                           ^
error: expect(received).toEqual(expected)

Expected: �[32m0�[0m
Received: �[31mundefined�[0m

      at /Users/morse/Documents/GitHub/elysia/test/core/elysia.test.ts:145:38
(fail) Edge Case > preserve correct index order of routes if duplicated [0.04ms]
158 | 			.get('/1', () => '1')
159 | 			.get('/2', () => '2')
160 | 			.use(plugin)
161 | 
162 | 		// @ts-expect-error
163 | 		expect(app.routeTree.get('GET/0')).toEqual(0)
                                           ^
error: expect(received).toEqual(expected)

Expected: �[32m0�[0m
Received: �[31mundefined�[0m

      at /Users/morse/Documents/GitHub/elysia/test/core/elysia.test.ts:163:38
(fail) Edge Case > preserve correct index order of routes if duplicated from plugin [0.17ms]
(pass) Edge Case > get getGlobalRoutes [0.07ms]

test/core/handle-error.test.ts:
(pass) Handle Error > handle NOT_FOUND [1.18ms]
(pass) Handle Error > handle INTERNAL_SERVER_ERROR [0.04ms]
(pass) Handle Error > handle VALIDATION [0.10ms]
(pass) Handle Error > use custom error [0.19ms]
(pass) Handle Error > inject headers to error [0.10ms]
(pass) Handle Error > transform any to error [0.02ms]
116 | 
117 | 		const app = new Elysia().use(authenticate)
118 | 
119 | 		const response = await app.handle(req('/group/inner'))
120 | 
121 | 		expect(await response.text()).toEqual('handled')
                                      ^
error: expect(received).toEqual(expected)

Expected: "handled"
Received: "A"

      at /Users/morse/Documents/GitHub/elysia/test/core/handle-error.test.ts:121:33
(fail) Handle Error > handle error in group [0.23ms]
137 | 
138 | 		const app = new Elysia().use(authenticate)
139 | 
140 | 		const response = await app.handle(req('/group/inner'))
141 | 
142 | 		expect(await response.text()).toEqual('handled')
                                      ^
error: expect(received).toEqual(expected)

Expected: "handled"
Received: "A"

      at /Users/morse/Documents/GitHub/elysia/test/core/handle-error.test.ts:142:33
(fail) Handle Error > handle error status in group [0.16ms]
148 | 			throw error(404, 'Not Found :(')
149 | 		})
150 | 
151 | 		const response = await app.handle(req('/'))
152 | 
153 | 		expect(await response.text()).toEqual('Not Found :(')
                                      ^
error: expect(received).toEqual(expected)

Expected: "Not Found :("
Received: ""

      at /Users/morse/Documents/GitHub/elysia/test/core/handle-error.test.ts:153:33
(fail) Handle Error > handle thrown error function [0.11ms]
159 | 			throw error(404, 'Not Found :(')
160 | 		})
161 | 
162 | 		const response = await app.handle(req('/'))
163 | 
164 | 		expect(await response.text()).toEqual('Not Found :(')
                                      ^
error: expect(received).toEqual(expected)

Expected: "Not Found :("
Received: ""

      at /Users/morse/Documents/GitHub/elysia/test/core/handle-error.test.ts:164:33
(fail) Handle Error > handle thrown Response [0.02ms]

test/core/dynamic.test.ts:
(pass) Dynamic Mode > handle path
(pass) Dynamic Mode > handle body [0.88ms]
(pass) Dynamic Mode > handle dynamic all method [0.03ms]
(pass) Dynamic Mode > inherits plugin [0.02ms]
(pass) Dynamic Mode > use custom error [0.07ms]
(pass) Dynamic Mode > inject headers to error [0.03ms]
(pass) Dynamic Mode > transform any to error [0.08ms]
(pass) Dynamic Mode > derive [0.02ms]
(pass) Dynamic Mode > validate [0.02ms]
(pass) Dynamic Mode > handle non query fallback [0.13ms]

test/validator/query.test.ts:
(pass) Query Validator > validate single
(pass) Query Validator > validate with hyphen in key [0.75ms]
(pass) Query Validator > validate with dot in key [0.10ms]
(pass) Query Validator > validate multiple [0.16ms]
(pass) Query Validator > parse without reference [0.02ms]
(pass) Query Validator > validate optional [0.07ms]
109 | 				age: t.Numeric()
110 | 			})
111 | 		})
112 | 		const res = await app.handle(req('/?name=sucrose&job=alchemist&age=16'))
113 | 
114 | 		expect(await res.json()).toEqual({
                                 ^
error: expect(received).toEqual(expected)

  {
+   age: "16",
-   age: 16,
    job: "alchemist",
    name: "sucrose",
  }

- Expected  - 1
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:114:28
(fail) Query Validator > parse single numeric [0.44ms]
131 | 		})
132 | 		const res = await app.handle(
133 | 			req('/?name=sucrose&job=alchemist&age=16&rank=4')
134 | 		)
135 | 
136 | 		expect(await res.json()).toEqual({
                                 ^
error: expect(received).toEqual(expected)

  {
+   age: "16",
-   age: 16,
    job: "alchemist",
    name: "sucrose",
+   rank: "4",
-   rank: 4,
  }

- Expected  - 2
+ Received  + 2

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:136:28
(fail) Query Validator > parse multiple numeric [0.24ms]
(pass) Query Validator > validate partial [0.04ms]
(pass) Query Validator > parse numeric with partial [0.11ms]
183 | 			})
184 | 		})
185 | 		const res = await app.handle(req('/?param1=true'))
186 | 
187 | 		expect(res.status).toBe(200)
188 | 		expect(await res.json()).toEqual({ param1: true })
                                 ^
error: expect(received).toEqual(expected)

  {
+   param1: "true",
-   param1: true,
  }

- Expected  - 1
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:188:28
(fail) Query Validator > parse boolean string [0.13ms]
195 | 			})
196 | 		})
197 | 		const res = await app.handle(req('/'))
198 | 
199 | 		expect(res.status).toBe(200)
200 | 		expect(await res.json()).toEqual({ param1: true })
                                 ^
error: expect(received).toEqual(expected)

+ {}
- {
-   param1: true,
- }

- Expected  - 3
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:200:28
(fail) Query Validator > parse optional boolean string [0.20ms]
224 | 		])
225 | 
226 | 		expect(await valid.text()).toBe('sucrose')
227 | 		expect(valid.status).toBe(200)
228 | 
229 | 		expect(await invalid.text()).toBe('sucrose')
                                     ^
error: expect(received).toBe(expected)

Expected: "sucrose"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"query\",\n  \"summary\": \"Property 'name' is missing\",\n  \"property\": \"/name\",\n  \"message\": \"Required property\",\n  \"expected\": {\n    \"name\": \"\"\n  },\n  \"found\": {},\n  \"errors\": [\n    {\n      \"type\": 45,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"/name\",\n      \"message\": \"Required property\",\n      \"summary\": \"Property 'name' is missing\"\n    },\n    {\n      \"type\": 54,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"/name\",\n      \"message\": \"Expected string\",\n      \"summary\": \"Expected  property 'name' to be  string but found: undefined\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:229:32
(fail) Query Validator > validate optional object [0.17ms]
240 | 
241 | 		const value = await app
242 | 			.handle(req('/?name=nagisa'))
243 | 			.then((x) => x.json())
244 | 
245 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/faction",
+       schema: {
+         default: "tea_party",
+         type: "string",
+       },
+       summary: "Property 'faction' is missing",
+       type: 45,
+     },
+     {
+       message: "Expected string",
+       path: "/faction",
+       schema: {
+         default: "tea_party",
+         type: "string",
+       },
+       summary: "Expected  property 'faction' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     faction: "tea_party",
+     name: "",
+   },
+   found: {
+     name: "nagisa",
+   },
+   message: "Required property",
+   on: "query",
+   property: "/faction",
+   summary: "Property 'faction' is missing",
+   type: "validation",
-   faction: "tea_party",
-   name: "nagisa",
  }

- Expected  - 2
+ Received  + 34

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:245:17
(fail) Query Validator > create default string query [0.24ms]
258 | 
259 | 		const value = await app
260 | 			.handle(req('/?name=nagisa'))
261 | 			.then((x) => x.json())
262 | 
263 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             default: 1,
+             type: "number",
+           }
+         ],
+         default: 1,
+       },
+       summary: "Property 'rank' is missing",
+       type: 45,
+     },
+     {
+       message: "Expected union value",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             default: 1,
+             type: "number",
+           }
+         ],
+         default: 1,
+       },
+       summary: "Property 'rank' should be one of: 'numeric', 'number'",
+       type: 62,
+     }
+   ],
+   expected: {
+     name: "",
+     rank: 1,
+   },
+   found: {
+     name: "nagisa",
+   },
+   message: "Required property",
+   on: "query",
+   property: "/rank",
+   summary: "Property 'rank' is missing",
+   type: "validation",
-   name: "nagisa",
-   rank: 1,
  }

- Expected  - 2
+ Received  + 54

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:263:17
(fail) Query Validator > create default number query [0.23ms]
(pass) Query Validator > handle query edge case [0.03ms]
312 | 				})
313 | 			})
314 | 			.handle(new Request(`http://localhost/?${params.toString()}`))
315 | 			.then((res) => res.json())
316 | 
317 | 		expect(response).toEqual({ keys: ['1', '2'] })
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Expected union value",
+       path: "/keys",
+       schema: {
+         anyOf: [
+           {
+             default: "[]",
+             format: "ArrayString",
+             items: {
+               type: "string",
+             },
+             type: "string",
+           },
+           {
+             items: {
+               type: "string",
+             },
+             type: "array",
+           }
+         ],
+         items: {
+           type: "string",
+         },
+       },
+       summary: "Property 'keys' should be one of: 'ArrayString', 'array'",
+       type: 62,
+       value: "1",
+     }
-   keys: [
-     "1",
-     "2"
    ],
+   expected: {
+     keys: "[]",
+   },
+   found: {
+     keys: "1",
+   },
+   message: "Expected union value",
+   on: "query",
+   property: "/keys",
+   summary: "Property 'keys' should be one of: 'ArrayString', 'array'",
+   type: "validation",
  }

- Expected  - 3
+ Received  + 40

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:317:20
(fail) Query Validator > parse query array [0.75ms]
339 | 					])}`
340 | 				)
341 | 			)
342 | 			.then((x) => x.json())
343 | 
344 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   role: "[{\"name\":\"hello\"},{\"name\":\"world\"}]",
-   role: [
-     {
-       name: "hello",
-     },
-     {
-       name: "world",
-     }
-   ],
  }

- Expected  - 8
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:344:20
(fail) Query Validator > parse query object [0.32ms]
370 | 					])}`
371 | 				)
372 | 			)
373 | 			.then((x) => x.json())
374 | 
375 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   role: "[{\"name\":\"hello\"},{\"name\":\"world\"}]",
-   role: [
-     {
-       name: "hello",
-     },
-     {
-       name: "world",
-     }
-   ],
  }

- Expected  - 8
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:375:20
(fail) Query Validator > parse optional query object [0.29ms]
393 | 				})
394 | 			})
395 | 			.handle(new Request(`http://localhost/?${params.toString()}`))
396 | 			.then((res) => res.json())
397 | 
398 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   keys: "{\"a\":\"hello\"}",
-   keys: [
-     {
-       a: "hello",
-     },
-     {
-       a: "hi",
-     }
-   ],
  }

- Expected  - 8
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:398:20
(fail) Query Validator > parse array with nested object [0.15ms]
418 | 				)
419 | 			})
420 | 			.handle(new Request(`http://localhost/?${params.toString()}`))
421 | 			.then((res) => res.json())
422 | 
423 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   keys: "{\"a\":\"hello\"}",
-   keys: [
-     {
-       a: "hello",
-     },
-     {
-       a: "hi",
-     }
-   ],
  }

- Expected  - 8
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:423:20
(fail) Query Validator > parse optional array with nested object [0.33ms]
443 | 				)
444 | 			})
445 | 			.handle(new Request(`http://localhost/?${params.toString()}`))
446 | 			.then((res) => res.json())
447 | 
448 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   keys: "{\"a\":\"hello\"}",
-   keys: [
-     {
-       a: "hello",
-     },
-     {
-       a: "hi",
-     }
-   ],
  }

- Expected  - 8
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:448:20
(fail) Query Validator > parse query object array without schema [0.20ms]
(pass) Query Validator > don't parse query object without schema [0.13ms]
487 | 
488 | 		const response = await app
489 | 			.handle(req(`/?ids=1&ids=${JSON.stringify({ a: 'b' })}`))
490 | 			.then((res) => res.json())
491 | 
492 | 		expect(response).toEqual([1, { a: 'b' }])
                         ^
error: expect(received).toEqual(expected)

Expected: �[32m[ 1, {
    a: "b",
  } ]�[0m
Received: �[31m1�[0m

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:492:20
(fail) Query Validator > parse union primitive and object [0.57ms]
499 | 			})
500 | 		})
501 | 
502 | 		const value = await app.handle(req('/?id=1')).then((x) => x.text())
503 | 
504 | 		expect(value).toBe('number')
                      ^
error: expect(received).toBe(expected)

Expected: "number"
Received: "string"

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:504:17
(fail) Query Validator > coerce number object to numeric [0.22ms]
517 | 
518 | 		const value = await app
519 | 			.handle(req('/?isAdmin=true'))
520 | 			.then((x) => x.text())
521 | 
522 | 		expect(value).toBe('boolean')
                      ^
error: expect(received).toBe(expected)

Expected: "boolean"
Received: "string"

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:522:17
(fail) Query Validator > coerce string object to boolean [0.13ms]
(pass) Query Validator > don't parse object automatically unless explicitly specified [0.03ms]
557 | 					`/?pagination=${JSON.stringify([{ pageIndex: 1, pageLimit: 10 }])}`
558 | 				)
559 | 			)
560 | 			.then((x) => x.json())
561 | 
562 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   pagination: "[{\"pageIndex\":1,\"pageLimit\":10}]",
-   pagination: [
-     {
-       pageIndex: 1,
-       pageLimit: 10,
-     }
-   ],
  }

- Expected  - 6
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:562:20
(fail) Query Validator > handle object array in single query [0.39ms]
582 | 					`/?pagination=${JSON.stringify({ pageIndex: 1, pageLimit: 10 })}&pagination=${JSON.stringify({ pageIndex: 2, pageLimit: 9 })}`
583 | 				)
584 | 			)
585 | 			.then((x) => x.json())
586 | 
587 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   pagination: "{\"pageIndex\":1,\"pageLimit\":10}",
-   pagination: [
-     {
-       pageIndex: 1,
-       pageLimit: 10,
-     },
-     {
-       pageIndex: 2,
-       pageLimit: 9,
-     }
-   ],
  }

- Expected  - 10
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:587:20
(fail) Query Validator > handle merge object to array in multiple query [0.26ms]
609 | 					name: 'test'
610 | 				})}`
611 | 			)
612 | 		)
613 | 
614 | 		expect(response.status).toBe(422)
                                ^
error: expect(received).toBe(expected)

Expected: 422
Received: 200

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:614:27
(fail) Query Validator > don	 coerce number in nested object [0.22ms]
626 | 		const res = await Promise.all([
627 | 			app.handle(req('/')).then((x) => x.json()),
628 | 			app.handle(req('/?id=1')).then((x) => x.json())
629 | 		])
630 | 
631 | 		expect(res).toEqual([{}, { id: 1 }])
                    ^
error: expect(received).toEqual(expected)

  [
+   {
+     errors: [
+       {
+         message: "Required property",
+         path: "/id",
+         schema: {
+           anyOf: [
+             {
+               default: 0,
+               format: "numeric",
+               type: "string",
+             },
+             {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             }
+           ],
+         },
+         summary: "Property 'id' is missing",
+         type: 45,
+       },
+       {
+         message: "Expected union value",
+         path: "/id",
+         schema: {
+           anyOf: [
+             {
+               default: 0,
+               format: "numeric",
+               type: "string",
+             },
+             {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             }
+           ],
+         },
+         summary: "Property 'id' should be one of: 'numeric', 'undefined'",
+         type: 62,
+       }
+     ],
+     expected: {
+       id: 0,
+     },
+     found: {},
+     message: "Required property",
+     on: "query",
+     property: "/id",
+     summary: "Property 'id' is missing",
+     type: "validation",
+   },
-   {},
    {
+     id: "1",
-     id: 1,
    }
  ]

- Expected  - 2
+ Received  + 68

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:631:15
(fail) Query Validator > handle optional at root [0.41ms]
643 | 		// console.log(app.routes[0].composed?.toString())
644 | 
645 | 		const response = await app.handle(req('/?leading=foo&arr=bar&arr=baz&trailing=qux&arr=xd'))
646 | 			.then((x) => x.json())
647 | 
648 | 		expect(response).toEqual({
                         ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Expected union value",
+       path: "/arr",
+       schema: {
+         anyOf: [
+           {
+             default: "[]",
+             format: "ArrayString",
+             items: {
+               type: "string",
+             },
+             type: "string",
+           },
+           {
+             items: {
+               type: "string",
+             },
+             type: "array",
+           }
+         ],
+         items: {
+           type: "string",
+         },
+       },
+       summary: "Property 'arr' should be one of: 'ArrayString', 'array'",
+       type: 62,
+       value: "bar",
+     }
-   arr: [
-     "bar",
-     "baz",
-     "xd"
    ],
+   expected: {
+     arr: "[]",
+     leading: "",
+     trailing: "",
+   },
+   found: {
+     arr: "bar",
+     leading: "foo",
+     trailing: "qux",
+   },
+   message: "Expected union value",
+   on: "query",
+   property: "/arr",
+   summary: "Property 'arr' should be one of: 'ArrayString', 'array'",
+   type: "validation",
-   leading: "foo",
-   trailing: "qux",
  }

- Expected  - 6
+ Received  + 44

      at /Users/morse/Documents/GitHub/elysia/test/validator/query.test.ts:648:20
(fail) Query Validator > parse query array in multiple location correctly [0.33ms]

test/validator/header.test.ts:
17 | 					name: 'sucrose'
18 | 				}
19 | 			})
20 | 		)
21 | 
22 | 		expect(await res.text()).toBe('sucrose')
                                ^
error: expect(received).toBe(expected)

Expected: "sucrose"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"header\",\n  \"summary\": \"Property 'name' is missing\",\n  \"property\": \"/name\",\n  \"message\": \"Required property\",\n  \"expected\": {\n    \"name\": \"\"\n  },\n  \"found\": {\n    \"append\": null,\n    \"delete\": null,\n    \"get\": null,\n    \"getAll\": null,\n    \"has\": null,\n    \"set\": null,\n    \"entries\": null,\n    \"keys\": null,\n    \"values\": null,\n    \"forEach\": null,\n    \"toJSON\": null,\n    \"count\": null,\n    \"getSetCookie\": null\n  },\n  \"errors\": [\n    {\n      \"type\": 45,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"/name\",\n      \"message\": \"Required property\",\n      \"summary\": \"Property 'name' is missing\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/append\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'append' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/delete\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'delete' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/get\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'get' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/getAll\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'getAll' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/has\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'has' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/set\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'set' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/entries\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'entries' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/keys\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'keys' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/values\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'values' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/forEach\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'forEach' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/toJSON\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'toJSON' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/count\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'count' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/getSetCookie\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'getSetCookie' should not be provided\"\n    },\n    {\n      \"type\": 54,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"/name\",\n      \"message\": \"Expected string\",\n      \"summary\": \"Expected  property 'name' to be  string but found: undefined\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:22:28
(fail) Header Validator > validate single [1.69ms]
39 | 					trait: 'dog'
40 | 				}
41 | 			})
42 | 		)
43 | 
44 | 		expect(await res.json()).toEqual({
                                ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'job' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/trait",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'trait' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "trait"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected string",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'job' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected string",
+       path: "/trait",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'trait' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     job: "",
+     name: "",
+     trait: "",
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   job: "alchemist",
-   name: "sucrose",
-   trait: "dog",
  }

- Expected  - 3
+ Received  + 432

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:44:28
(fail) Header Validator > validate multiple [0.43ms]
65 | 					trait: 'dog'
66 | 				}
67 | 			})
68 | 		)
69 | 
70 | 		expect(res.status).toBe(200)
                          ^
error: expect(received).toBe(expected)

Expected: 200
Received: 422

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:70:22
(fail) Header Validator > parse without reference [0.17ms]
85 | 					job: 'alchemist'
86 | 				}
87 | 			})
88 | 		)
89 | 
90 | 		expect(await res.json()).toEqual({
                                ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'job' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected string",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'job' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     job: "",
+     name: "",
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   job: "alchemist",
-   name: "sucrose",
  }

- Expected  - 2
+ Received  + 400

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:90:28
(fail) Header Validator > validate optional [0.32ms]
111 | 					age: '16'
112 | 				}
113 | 			})
114 | 		)
115 | 
116 | 		expect(await res.json()).toEqual({
                                 ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'job' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/age",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 type: "number",
+               }
+             ],
+           }
+         ],
+       },
+       summary: "Property 'age' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected string",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'job' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected union value",
+       path: "/age",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 type: "number",
+               }
+             ],
+           }
+         ],
+       },
+       summary: "Property 'age' should be one of: 'numeric', 'undefined'",
+       type: 62,
+     }
+   ],
+   expected: {
+     age: 0,
+     job: "",
+     name: "",
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   age: 16,
-   job: "alchemist",
-   name: "sucrose",
  }

- Expected  - 3
+ Received  + 741

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:116:28
(fail) Header Validator > parse single numeric [0.47ms]
140 | 					rank: '4'
141 | 				}
142 | 			})
143 | 		)
144 | 
145 | 		expect(await res.json()).toEqual({
                                 ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'job' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/age",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 type: "number",
+               }
+             ],
+           }
+         ],
+       },
+       summary: "Property 'age' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 type: "number",
+               }
+             ],
+           }
+         ],
+       },
+       summary: "Property 'rank' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           age: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           job: {
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 anyOf: [
+                   {
+                     default: 0,
+                     format: "numeric",
+                     type: "string",
+                   },
+                   {
+                     type: "number",
+                   }
+                 ],
+               }
+             ],
+           },
+           trait: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "job",
+           "age",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected string",
+       path: "/job",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'job' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected union value",
+       path: "/age",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 type: "number",
+               }
+             ],
+           }
+         ],
+       },
+       summary: "Property 'age' should be one of: 'numeric', 'undefined'",
+       type: 62,
+     },
+     {
+       message: "Expected union value",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 type: "number",
+               }
+             ],
+           }
+         ],
+       },
+       summary: "Property 'rank' should be one of: 'numeric', 'undefined'",
+       type: 62,
+     }
+   ],
+   expected: {
+     age: 0,
+     job: "",
+     name: "",
+     rank: 0,
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   age: 16,
-   job: "alchemist",
-   name: "sucrose",
-   rank: 4,
  }

- Expected  - 4
+ Received  + 1082

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:145:28
(fail) Header Validator > parse multiple numeric [0.56ms]
161 | 				})
162 | 			)
163 | 		})
164 | 		const res = await app.handle(req('/'))
165 | 
166 | 		expect(res.status).toBe(200)
                           ^
error: expect(received).toBe(expected)

Expected: 200
Received: 422

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:166:22
(fail) Header Validator > validate partial [0.09ms]
179 | 				})
180 | 			)
181 | 		})
182 | 		const res = await app.handle(req('/'))
183 | 
184 | 		expect(res.status).toBe(200)
                           ^
error: expect(received).toBe(expected)

Expected: 200
Received: 422

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:184:22
(fail) Header Validator > validate numeric with partial [0.31ms]
212 | 				})
213 | 			),
214 | 			app.handle(req('/'))
215 | 		])
216 | 
217 | 		expect(await valid.text()).toBe('sucrose')
                                   ^
error: expect(received).toBe(expected)

Expected: "sucrose"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"header\",\n  \"summary\": \"Property 'name' is missing\",\n  \"property\": \"/name\",\n  \"message\": \"Required property\",\n  \"expected\": {\n    \"name\": \"\"\n  },\n  \"found\": {\n    \"append\": null,\n    \"delete\": null,\n    \"get\": null,\n    \"getAll\": null,\n    \"has\": null,\n    \"set\": null,\n    \"entries\": null,\n    \"keys\": null,\n    \"values\": null,\n    \"forEach\": null,\n    \"toJSON\": null,\n    \"count\": null,\n    \"getSetCookie\": null\n  },\n  \"errors\": [\n    {\n      \"type\": 45,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"/name\",\n      \"message\": \"Required property\",\n      \"summary\": \"Property 'name' is missing\"\n    },\n    {\n      \"type\": 54,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"/name\",\n      \"message\": \"Expected string\",\n      \"summary\": \"Expected  property 'name' to be  string but found: undefined\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:217:30
(fail) Header Validator > validate optional object [0.23ms]
237 | 					}
238 | 				})
239 | 			)
240 | 			.then((x) => x.json())
241 | 
242 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/faction",
+       schema: {
+         default: "tea_party",
+         type: "string",
+       },
+       summary: "Property 'faction' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           faction: {
+             default: "tea_party",
+             type: "string",
+           },
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name",
+           "faction"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected string",
+       path: "/faction",
+       schema: {
+         default: "tea_party",
+         type: "string",
+       },
+       summary: "Expected  property 'faction' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     faction: "tea_party",
+     name: "",
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   faction: "tea_party",
-   name: "nagisa",
  }

- Expected  - 2
+ Received  + 376

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:242:17
(fail) Header Validator > create default string params [0.33ms]
261 | 					}
262 | 				})
263 | 			)
264 | 			.then((x) => x.json())
265 | 
266 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Property 'name' is missing",
+       type: 45,
+     },
+     {
+       message: "Required property",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             default: 1,
+             type: "number",
+           }
+         ],
+         default: 1,
+       },
+       summary: "Property 'rank' is missing",
+       type: 45,
+     },
+     {
+       message: "Unexpected property",
+       path: "/append",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'append' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/delete",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'delete' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/get",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'get' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getAll",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getAll' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/has",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'has' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/set",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'set' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/entries",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'entries' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/keys",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'keys' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/values",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'values' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/forEach",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'forEach' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/toJSON",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'toJSON' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/count",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'count' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Unexpected property",
+       path: "/getSetCookie",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+           rank: {
+             anyOf: [
+               {
+                 default: 0,
+                 format: "numeric",
+                 type: "string",
+               },
+               {
+                 default: 1,
+                 type: "number",
+               }
+             ],
+             default: 1,
+           },
+         },
+         required: [
+           "name",
+           "rank"
+         ],
+         type: "object",
+       },
+       summary: "Property 'getSetCookie' should not be provided",
+       type: 42,
+       value: null,
+     },
+     {
+       message: "Expected string",
+       path: "/name",
+       schema: {
+         type: "string",
+       },
+       summary: "Expected  property 'name' to be  string but found: undefined",
+       type: 54,
+     },
+     {
+       message: "Expected union value",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             default: 1,
+             type: "number",
+           }
+         ],
+         default: 1,
+       },
+       summary: "Property 'rank' should be one of: 'numeric', 'number'",
+       type: 62,
+     }
+   ],
+   expected: {
+     name: "",
+     rank: 1,
+   },
+   found: {
+     append: null,
+     count: null,
+     delete: null,
+     entries: null,
+     forEach: null,
+     get: null,
+     getAll: null,
+     getSetCookie: null,
+     has: null,
+     keys: null,
+     set: null,
+     toJSON: null,
+     values: null,
+   },
+   message: "Required property",
+   on: "header",
+   property: "/name",
+   summary: "Property 'name' is missing",
+   type: "validation",
-   name: "nagisa",
-   rank: 1,
  }

- Expected  - 2
+ Received  + 526

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:266:17
(fail) Header Validator > create default number params [0.37ms]
284 | 					}
285 | 				})
286 | 			)
287 | 			.then((x) => x.text())
288 | 
289 | 		expect(value).toBe('number')
                      ^
error: expect(received).toBe(expected)

Expected: "number"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"header\",\n  \"summary\": \"Property 'id' is missing\",\n  \"property\": \"/id\",\n  \"message\": \"Required property\",\n  \"expected\": {\n    \"id\": 0\n  },\n  \"found\": {\n    \"append\": null,\n    \"delete\": null,\n    \"get\": null,\n    \"getAll\": null,\n    \"has\": null,\n    \"set\": null,\n    \"entries\": null,\n    \"keys\": null,\n    \"values\": null,\n    \"forEach\": null,\n    \"toJSON\": null,\n    \"count\": null,\n    \"getSetCookie\": null\n  },\n  \"errors\": [\n    {\n      \"type\": 45,\n      \"schema\": {\n        \"anyOf\": [\n          {\n            \"format\": \"numeric\",\n            \"default\": 0,\n            \"type\": \"string\"\n          },\n          {\n            \"type\": \"number\"\n          }\n        ]\n      },\n      \"path\": \"/id\",\n      \"message\": \"Required property\",\n      \"summary\": \"Property 'id' is missing\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/append\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'append' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/delete\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'delete' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/get\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'get' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/getAll\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'getAll' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/has\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'has' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/set\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'set' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/entries\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'entries' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/keys\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'keys' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/values\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'values' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/forEach\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'forEach' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/toJSON\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'toJSON' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/count\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'count' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"anyOf\": [\n              {\n                \"format\": \"numeric\",\n                \"default\": 0,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"number\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/getSetCookie\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'getSetCookie' should not be provided\"\n    },\n    {\n      \"type\": 62,\n      \"schema\": {\n        \"anyOf\": [\n          {\n            \"format\": \"numeric\",\n            \"default\": 0,\n            \"type\": \"string\"\n          },\n          {\n            \"type\": \"number\"\n          }\n        ]\n      },\n      \"path\": \"/id\",\n      \"message\": \"Expected union value\",\n      \"summary\": \"Property 'id' should be one of: 'numeric', 'number'\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:289:17
(fail) Header Validator > coerce number object to numeric [0.15ms]
308 | 					}
309 | 				})
310 | 			)
311 | 			.then((x) => x.text())
312 | 
313 | 		expect(value).toBe('boolean')
                      ^
error: expect(received).toBe(expected)

Expected: "boolean"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"header\",\n  \"summary\": \"Property 'is-admin' is missing\",\n  \"property\": \"/is-admin\",\n  \"message\": \"Required property\",\n  \"expected\": {\n    \"is-admin\": false\n  },\n  \"found\": {\n    \"append\": null,\n    \"delete\": null,\n    \"get\": null,\n    \"getAll\": null,\n    \"has\": null,\n    \"set\": null,\n    \"entries\": null,\n    \"keys\": null,\n    \"values\": null,\n    \"forEach\": null,\n    \"toJSON\": null,\n    \"count\": null,\n    \"getSetCookie\": null\n  },\n  \"errors\": [\n    {\n      \"type\": 45,\n      \"schema\": {\n        \"anyOf\": [\n          {\n            \"format\": \"boolean\",\n            \"default\": false,\n            \"type\": \"string\"\n          },\n          {\n            \"type\": \"boolean\"\n          }\n        ]\n      },\n      \"path\": \"/is-admin\",\n      \"message\": \"Required property\",\n      \"summary\": \"Property 'is-admin' is missing\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/append\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'append' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/delete\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'delete' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/get\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'get' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/getAll\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'getAll' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/has\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'has' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/set\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'set' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/entries\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'entries' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/keys\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'keys' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/values\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'values' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/forEach\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'forEach' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/toJSON\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'toJSON' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/count\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'count' should not be provided\"\n    },\n    {\n      \"type\": 42,\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"is-admin\"\n        ],\n        \"properties\": {\n          \"is-admin\": {\n            \"anyOf\": [\n              {\n                \"format\": \"boolean\",\n                \"default\": false,\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"boolean\"\n              }\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"path\": \"/getSetCookie\",\n      \"value\": null,\n      \"message\": \"Unexpected property\",\n      \"summary\": \"Property 'getSetCookie' should not be provided\"\n    },\n    {\n      \"type\": 62,\n      \"schema\": {\n        \"anyOf\": [\n          {\n            \"format\": \"boolean\",\n            \"default\": false,\n            \"type\": \"string\"\n          },\n          {\n            \"type\": \"boolean\"\n          }\n        ]\n      },\n      \"path\": \"/is-admin\",\n      \"message\": \"Expected union value\",\n      \"summary\": \"Property 'is-admin' should be one of: 'boolean', 'boolean'\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:313:17
(fail) Header Validator > coerce string to boolean [0.24ms]
333 | 					})
334 | 				)
335 | 				.then((x) => x.json())
336 | 		])
337 | 
338 | 		expect(res).toEqual([{}, { id: 1 }])
                    ^
error: expect(received).toEqual(expected)

  [
+   {
+     errors: [
+       {
+         message: "Required property",
+         path: "/id",
+         schema: {
+           anyOf: [
+             {
+               default: 0,
+               format: "numeric",
+               type: "string",
+             },
+             {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             }
+           ],
+         },
+         summary: "Property 'id' is missing",
+         type: 45,
+       },
+       {
+         message: "Unexpected property",
+         path: "/append",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'append' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/delete",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'delete' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/get",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'get' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/getAll",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'getAll' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/has",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'has' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/set",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'set' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/entries",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'entries' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/keys",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'keys' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/values",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'values' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/forEach",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'forEach' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/toJSON",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'toJSON' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/count",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'count' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/getSetCookie",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'getSetCookie' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Expected union value",
+         path: "/id",
+         schema: {
+           anyOf: [
+             {
+               default: 0,
+               format: "numeric",
+               type: "string",
+             },
+             {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             }
+           ],
+         },
+         summary: "Property 'id' should be one of: 'numeric', 'undefined'",
+         type: 62,
+       }
+     ],
+     expected: {
+       id: 0,
+     },
+     found: {
+       append: null,
+       count: null,
+       delete: null,
+       entries: null,
+       forEach: null,
+       get: null,
+       getAll: null,
+       getSetCookie: null,
+       has: null,
+       keys: null,
+       set: null,
+       toJSON: null,
+       values: null,
+     },
+     message: "Required property",
+     on: "header",
+     property: "/id",
+     summary: "Property 'id' is missing",
+     type: "validation",
+   },
-   {},
    {
+     errors: [
+       {
+         message: "Required property",
+         path: "/id",
+         schema: {
+           anyOf: [
+             {
+               default: 0,
+               format: "numeric",
+               type: "string",
+             },
+             {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             }
+           ],
+         },
+         summary: "Property 'id' is missing",
+         type: 45,
+       },
+       {
+         message: "Unexpected property",
+         path: "/append",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'append' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/delete",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'delete' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/get",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'get' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/getAll",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'getAll' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/has",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'has' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/set",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'set' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/entries",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'entries' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/keys",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'keys' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/values",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'values' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/forEach",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'forEach' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/toJSON",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'toJSON' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/count",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'count' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Unexpected property",
+         path: "/getSetCookie",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   anyOf: [
+                     {
+                       default: 0,
+                       format: "numeric",
+                       type: "string",
+                     },
+                     {
+                       type: "number",
+                     }
+                   ],
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Property 'getSetCookie' should not be provided",
+         type: 42,
+         value: null,
+       },
+       {
+         message: "Expected union value",
+         path: "/id",
+         schema: {
+           anyOf: [
+             {
+               default: 0,
+               format: "numeric",
+               type: "string",
+             },
+             {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             }
+           ],
+         },
+         summary: "Property 'id' should be one of: 'numeric', 'undefined'",
+         type: 62,
+       }
+     ],
+     expected: {
+       id: 0,
+     },
+     found: {
+       append: null,
+       count: null,
+       delete: null,
+       entries: null,
+       forEach: null,
+       get: null,
+       getAll: null,
+       getSetCookie: null,
+       has: null,
+       keys: null,
+       set: null,
+       toJSON: null,
+       values: null,
+     },
+     message: "Required property",
+     on: "header",
+     property: "/id",
+     summary: "Property 'id' is missing",
+     type: "validation",
-     id: 1,
    }
  ]

- Expected  - 2
+ Received  + 1122

      at /Users/morse/Documents/GitHub/elysia/test/validator/header.test.ts:338:15
(fail) Header Validator > handle optional at root [0.83ms]

test/validator/body.test.ts:
(pass) Body Validator > validate single
(pass) Body Validator > validate multiple [0.58ms]
(pass) Body Validator > parse without reference [0.04ms]
(pass) Body Validator > validate optional [0.11ms]
101 | 				job: 'alchemist',
102 | 				age: '16'
103 | 			})
104 | 		)
105 | 
106 | 		expect(await res.json()).toEqual({
                                 ^
error: expect(received).toEqual(expected)

  {
+   age: "16",
-   age: 16,
    job: "alchemist",
    name: "sucrose",
  }

- Expected  - 1
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:106:28
(fail) Body Validator > parse single numeric [0.09ms]
129 | 				age: '16',
130 | 				rank: '4'
131 | 			})
132 | 		)
133 | 
134 | 		expect(await res.json()).toEqual({
                                 ^
error: expect(received).toEqual(expected)

  {
+   age: "16",
-   age: 16,
    job: "alchemist",
    name: "sucrose",
+   rank: "4",
-   rank: 4,
  }

- Expected  - 2
+ Received  + 2

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:134:28
(fail) Body Validator > parse multiple numeric [0.24ms]
(pass) Body Validator > validate empty body [0.07ms]
(pass) Body Validator > validate empty body with partial [0.24ms]
198 | 					job: 'alchemist'
199 | 				})
200 | 			)
201 | 			.then((x) => x.json())
202 | 
203 | 		expect(res).toEqual({
                    ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/job",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'job' should not be provided",
+       type: 42,
+       value: "alchemist",
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     job: "alchemist",
+     name: "sucrose",
+   },
+   message: "Unexpected property",
+   on: "body",
+   property: "/job",
+   summary: "Property 'job' should not be provided",
+   type: "validation",
-   name: "sucrose",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:203:15
(fail) Body Validator > normalize by default [0.04ms]
(pass) Body Validator > strictly validate if not normalize [0.03ms]
(pass) Body Validator > validate maybe empty body [0.09ms]
(pass) Body Validator > validate record [0.28ms]
(pass) Body Validator > validate record inside object [0.12ms]
309 | 		])
310 | 
311 | 		expect(await valid.text()).toBe('sucrose')
312 | 		expect(valid.status).toBe(200)
313 | 
314 | 		expect(await invalid.text()).toBe('sucrose')
                                     ^
error: expect(received).toBe(expected)

Expected: "sucrose"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"body\",\n  \"summary\": \"Expected  property '' to be  string but found: undefined\",\n  \"property\": \"root\",\n  \"message\": \"Expected string\",\n  \"expected\": \"\",\n  \"errors\": [\n    {\n      \"type\": 54,\n      \"schema\": {\n        \"type\": \"string\"\n      },\n      \"path\": \"\",\n      \"message\": \"Expected string\",\n      \"summary\": \"Expected  property '' to be  string but found: undefined\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:314:32
(fail) Body Validator > validate optional primitive [0.21ms]
342 | 		])
343 | 
344 | 		expect(await valid.text()).toBe('sucrose')
345 | 		expect(valid.status).toBe(200)
346 | 
347 | 		expect(await invalid.text()).toBe('sucrose')
                                     ^
error: expect(received).toBe(expected)

Expected: "sucrose"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"body\",\n  \"summary\": \"Expected object\",\n  \"property\": \"root\",\n  \"message\": \"Expected object\",\n  \"expected\": {\n    \"name\": \"\"\n  },\n  \"errors\": [\n    {\n      \"summary\": \"Expected object\",\n      \"type\": 46,\n      \"schema\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"name\"\n        ],\n        \"additionalProperties\": false\n      },\n      \"path\": \"\",\n      \"message\": \"Expected object\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:347:32
(fail) Body Validator > validate optional object [0.03ms]
366 | 					email: '[email protected]'
367 | 				})
368 | 			)
369 | 			.then((x) => x.json())
370 | 
371 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/isSuperuser",
+       schema: {
+         default: false,
+         type: "boolean",
+       },
+       summary: "Property 'isSuperuser' is missing",
+       type: 45,
+     },
+     {
+       message: "Expected boolean",
+       path: "/isSuperuser",
+       schema: {
+         default: false,
+         type: "boolean",
+       },
+       summary: "Expected boolean",
+       type: 14,
+     }
+   ],
+   expected: {
+     isSuperuser: false,
+     password: "",
+     username: "",
+   },
+   found: {
+     email: "[email protected]",
+     password: "hifumi_daisuki",
+     username: "nagisa",
+   },
+   message: "Required property",
+   on: "body",
+   property: "/isSuperuser",
+   summary: "Property 'isSuperuser' is missing",
+   type: "validation",
-   email: "[email protected]",
-   isSuperuser: false,
-   password: "hifumi_daisuki",
-   username: "nagisa",
  }

- Expected  - 4
+ Received  + 37

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:371:17
(fail) Body Validator > create default object body [0.03ms]
381 | 			body: t.String({ default: 'hifumi_daisuki' })
382 | 		})
383 | 
384 | 		const value = await app.handle(post('/')).then((x) => x.text())
385 | 
386 | 		expect(value).toBe('hifumi_daisuki')
                      ^
error: expect(received).toBe(expected)

Expected: "hifumi_daisuki"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"body\",\n  \"summary\": \"Expected  property '' to be  string but found: undefined\",\n  \"property\": \"root\",\n  \"message\": \"Expected string\",\n  \"expected\": \"hifumi_daisuki\",\n  \"errors\": [\n    {\n      \"type\": 54,\n      \"schema\": {\n        \"default\": \"hifumi_daisuki\",\n        \"type\": \"string\"\n      },\n      \"path\": \"\",\n      \"message\": \"Expected string\",\n      \"summary\": \"Expected  property '' to be  string but found: undefined\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:386:17
(fail) Body Validator > create default string body [0.26ms]
391 | 			body: t.Boolean({ default: true })
392 | 		})
393 | 
394 | 		const value = await app.handle(post('/')).then((x) => x.text())
395 | 
396 | 		expect(value).toBe('boolean')
                      ^
error: expect(received).toBe(expected)

Expected: "boolean"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"body\",\n  \"summary\": \"Expected boolean\",\n  \"property\": \"root\",\n  \"message\": \"Expected boolean\",\n  \"expected\": true,\n  \"errors\": [\n    {\n      \"summary\": \"Expected boolean\",\n      \"type\": 14,\n      \"schema\": {\n        \"default\": true,\n        \"type\": \"boolean\"\n      },\n      \"path\": \"\",\n      \"message\": \"Expected boolean\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:396:17
(fail) Body Validator > create default boolean body [0.11ms]
401 | 			body: t.Number({ default: 1 })
402 | 		})
403 | 
404 | 		const value = await app.handle(post('/')).then((x) => x.text())
405 | 
406 | 		expect(value).toBe('number')
                      ^
error: expect(received).toBe(expected)

Expected: "number"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"body\",\n  \"summary\": \"Expected number\",\n  \"property\": \"root\",\n  \"message\": \"Expected number\",\n  \"expected\": 1,\n  \"errors\": [\n    {\n      \"summary\": \"Expected number\",\n      \"type\": 41,\n      \"schema\": {\n        \"default\": 1,\n        \"type\": \"number\"\n      },\n      \"path\": \"\",\n      \"message\": \"Expected number\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:406:17
(fail) Body Validator > create default number body [0.15ms]
411 | 			body: t.Numeric({ default: 1 })
412 | 		})
413 | 
414 | 		const value = await app.handle(post('/')).then((x) => x.text())
415 | 
416 | 		expect(value).toBe('number')
                      ^
error: expect(received).toBe(expected)

Expected: "number"
Received: "{\n  \"type\": \"validation\",\n  \"on\": \"body\",\n  \"summary\": \"Value should be one of 'numeric', 'number'\",\n  \"property\": \"root\",\n  \"message\": \"Expected union value\",\n  \"expected\": 1,\n  \"errors\": [\n    {\n      \"type\": 62,\n      \"schema\": {\n        \"default\": 1,\n        \"anyOf\": [\n          {\n            \"format\": \"numeric\",\n            \"default\": 0,\n            \"type\": \"string\"\n          },\n          {\n            \"default\": 1,\n            \"type\": \"number\"\n          }\n        ]\n      },\n      \"path\": \"\",\n      \"message\": \"Expected union value\",\n      \"summary\": \"Value should be one of 'numeric', 'number'\"\n    }\n  ]\n}"

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:416:17
(fail) Body Validator > create default numeric body [0.06ms]
(pass) Body Validator > don't coerce number to numeric [0.15ms]
(pass) Body Validator > don't coerce number object to numeric [0.02ms]
(pass) Body Validator > don't coerce string to boolean [0.08ms]
(pass) Body Validator > don't coerce string object to boolean [0.05ms]
502 | 					})
503 | 				)
504 | 				.then((x) => x.json())
505 | 		])
506 | 
507 | 		expect(res).toEqual([{}, { id: 1 }])
                    ^
error: expect(received).toEqual(expected)

  [
+   {
+     errors: [
+       {
+         message: "Expected object",
+         path: "",
+         schema: {
+           additionalProperties: false,
+           properties: {
+             id: {
+               anyOf: [
+                 {
+                   default: 0,
+                   format: "numeric",
+                   type: "string",
+                 },
+                 {
+                   type: "number",
+                 }
+               ],
+             },
+           },
+           required: [
+             "id"
+           ],
+           type: "object",
+         },
+         summary: "Expected object",
+         type: 46,
+       }
+     ],
+     expected: {
+       id: 0,
+     },
+     message: "Expected object",
+     on: "body",
+     property: "root",
+     summary: "Expected object",
+     type: "validation",
+   },
-   {},
    {
      id: 1,
    }
  ]

- Expected  - 1
+ Received  + 39

      at /Users/morse/Documents/GitHub/elysia/test/validator/body.test.ts:507:15
(fail) Body Validator > handle optional at root [0.17ms]

test/validator/response.test.ts:
(pass) Response Validator > validate primitive
(pass) Response Validator > validate number [0.56ms]
(pass) Response Validator > validate boolean [0.11ms]
(pass) Response Validator > validate literal [0.04ms]
(pass) Response Validator > validate single [0.14ms]
(pass) Response Validator > validate multiple [0.03ms]
(pass) Response Validator > parse without reference [0.11ms]
(pass) Response Validator > validate optional [0.09ms]
(pass) Response Validator > allow undefined [0.03ms]
164 | 			}
165 | 		)
166 | 
167 | 		const res = await app.handle(req('/')).then((x) => x.json())
168 | 
169 | 		expect(res).toEqual({
                    ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Unexpected property",
+       path: "/job",
+       schema: {
+         additionalProperties: false,
+         properties: {
+           name: {
+             type: "string",
+           },
+         },
+         required: [
+           "name"
+         ],
+         type: "object",
+       },
+       summary: "Property 'job' should not be provided",
+       type: 42,
+       value: "alchemist",
+     }
+   ],
+   expected: {
+     name: "",
+   },
+   found: {
+     job: "alchemist",
+     name: "sucrose",
+   },
+   message: "Unexpected property",
+   on: "response",
+   property: "/job",
+   summary: "Property 'job' should not be provided",
+   type: "validation",
-   name: "sucrose",
  }

- Expected  - 1
+ Received  + 33

      at /Users/morse/Documents/GitHub/elysia/test/validator/response.test.ts:169:15
(fail) Response Validator > normalize by default [0.20ms]
(pass) Response Validator > strictly validate if not normalize [0.10ms]
(pass) Response Validator > handle File [2.07ms]
227 | 					upload('/', {
228 | 						files: 'aris-yuzu.jpg'
229 | 					}).request
230 | 				)
231 | 				.then((x) => x.text())
232 | 		).toEqual('true')
          ^
error: expect(received).toEqual(expected)

Expected: "true"
Received: "false"

      at /Users/morse/Documents/GitHub/elysia/test/validator/response.test.ts:232:5
(fail) Response Validator > convert File to Files automatically [0.72ms]
(pass) Response Validator > validate response per status [0.71ms]
(pass) Response Validator > validate response per status with error() [0.04ms]
(pass) Response Validator > use inline error from handler [0.05ms]
(pass) Response Validator > return null with schema [0.04ms]
(pass) Response Validator > return undefined with schema [0.04ms]
(pass) Response Validator > return void with schema [0.04ms]
(pass) Response Validator > return null with status based schema [0.06ms]
(pass) Response Validator > return static undefined with status based schema [0.05ms]
414 | 			app.handle(req('/ok')).then((x) => x.status),
415 | 			app.handle(req('/error')).then((x) => x.status),
416 | 			app.handle(req('/validate-error')).then((x) => x.status)
417 | 		])
418 | 
419 | 		expect(response).toEqual([200, 418, 422])
                         ^
error: expect(received).toEqual(expected)

  [
    200,
+   500,
+   500
-   418,
-   422
  ]

- Expected  - 2
+ Received  + 2

      at /Users/morse/Documents/GitHub/elysia/test/validator/response.test.ts:419:20
(fail) Response Validator > return error response with validator [0.04ms]

test/validator/validator.test.ts:
21 | 		const invalid = await app.handle(req('/invalid'))
22 | 
23 | 		expect(await res.text()).toBe('Mutsuki need correction 💢💢💢')
24 | 		expect(res.status).toBe(200)
25 | 
26 | 		expect(invalid.status).toBe(422)
                              ^
error: expect(received).toBe(expected)

Expected: 422
Received: 200

      at /Users/morse/Documents/GitHub/elysia/test/validator/validator.test.ts:26:26
(fail) Validator Additional Case > validate beforeHandle
41 | 		const invalid = await app.handle(req('/invalid'))
42 | 
43 | 		expect(await res.text()).toBe('Mutsuki need correction 💢💢💢')
44 | 
45 | 		expect(res.status).toBe(200)
46 | 		expect(invalid.status).toBe(422)
                              ^
error: expect(received).toBe(expected)

Expected: 422
Received: 200

      at /Users/morse/Documents/GitHub/elysia/test/validator/validator.test.ts:46:26
(fail) Validator Additional Case > validate afterHandle [0.03ms]
65 | 		const invalid = await app.handle(req('/invalid'))
66 | 
67 | 		expect(await res.text()).toBe('Mutsuki need correction 💢💢💢')
68 | 		expect(res.status).toBe(200)
69 | 
70 | 		expect(invalid.status).toBe(422)
                              ^
error: expect(received).toBe(expected)

Expected: 422
Received: 200

      at /Users/morse/Documents/GitHub/elysia/test/validator/validator.test.ts:70:26
(fail) Validator Additional Case > validate beforeHandle with afterHandle [0.16ms]
(pass) Validator Additional Case > handle guard hook [0.42ms]

test/validator/params.test.ts:
(pass) Params Validator > parse params without validator [0.17ms]
(pass) Params Validator > validate single [0.04ms]
(pass) Params Validator > validate multiple [0.28ms]
(pass) Params Validator > parse without reference [0.05ms]
61 | 				id: t.Numeric()
62 | 			})
63 | 		})
64 | 		const res = await app.handle(req('/id/617'))
65 | 
66 | 		expect(await res.json()).toEqual({
                                ^
error: expect(received).toEqual(expected)

  {
+   id: "617",
-   id: 617,
  }

- Expected  - 1
+ Received  + 1

      at /Users/morse/Documents/GitHub/elysia/test/validator/params.test.ts:66:28
(fail) Params Validator > parse single numeric [0.12ms]
80 | 				})
81 | 			}
82 | 		)
83 | 		const res = await app.handle(req('/id/617/chapter/12'))
84 | 
85 | 		expect(await res.json()).toEqual({
                                ^
error: expect(received).toEqual(expected)

  {
+   chapterId: "12",
+   id: "617",
-   chapterId: 12,
-   id: 617,
  }

- Expected  - 2
+ Received  + 2

      at /Users/morse/Documents/GitHub/elysia/test/validator/params.test.ts:85:28
(fail) Params Validator > parse multiple numeric [0.12ms]
 97 | 			})
 98 | 		})
 99 | 
100 | 		const value = await app.handle(req('/nagisa')).then((x) => x.json())
101 | 
102 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/faction",
+       schema: {
+         default: "tea_party",
+         type: "string",
+       },
+       summary: "Property 'faction' is missing",
+       type: 45,
+     },
+     {
+       message: "Expected string",
+       path: "/faction",
+       schema: {
+         default: "tea_party",
+         type: "string",
+       },
+       summary: "Expected  property 'faction' to be  string but found: undefined",
+       type: 54,
+     }
+   ],
+   expected: {
+     faction: "tea_party",
+     name: "",
+   },
+   found: {
+     name: "nagisa",
+   },
+   message: "Required property",
+   on: "params",
+   property: "/faction",
+   summary: "Property 'faction' is missing",
+   type: "validation",
-   faction: "tea_party",
-   name: "nagisa",
  }

- Expected  - 2
+ Received  + 34

      at /Users/morse/Documents/GitHub/elysia/test/validator/params.test.ts:102:17
(fail) Params Validator > create default string params [0.14ms]
113 | 			})
114 | 		})
115 | 
116 | 		const value = await app.handle(req('/nagisa')).then((x) => x.json())
117 | 
118 | 		expect(value).toEqual({
                      ^
error: expect(received).toEqual(expected)

  {
+   errors: [
+     {
+       message: "Required property",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             default: 1,
+             type: "number",
+           }
+         ],
+         default: 1,
+       },
+       summary: "Property 'rank' is missing",
+       type: 45,
+     },
+     {
+       message: "Expected union value",
+       path: "/rank",
+       schema: {
+         anyOf: [
+           {
+             default: 0,
+             format: "numeric",
+             type: "string",
+           },
+           {
+             default: 1,
+             type: "number",
+           }
+         ],
+         default: 1,
+       },
+       summary: "Property 'rank' should be one of: 'numeric', 'number'",
+       type: 62,
+     }
+   ],
+   expected: {
+     name: "",
+     rank: 1,
+   },
+   found: {
+     name: "nagisa",
+   },
+   message: "Required property",
+   on: "params",
+   property: "/rank",
+   summary: "Property 'rank' is missing",
+   type: "validation",
-   name: "nagisa",
-   rank: 1,
  }

- Expected  - 2
+ Received  + 54

      at /Users/morse/Documents/GitHub/elysia/test/validator/params.test.ts:118:17
(fail) Params Validator > create default number params [0.17ms]
132 | 			}
133 | 		)
134 | 
135 | 		const value = await app.handle(req('/id/1')).then((x) => x.text())
136 | 
137 | 		expect(value).toBe('number')
                      ^
error: expect(received).toBe(expected)

Expected: "number"
Received: "string"

      at /Users/morse/Documents/GitHub/elysia/test/validator/params.test.ts:137:17
(fail) Params Validator > coerce number object to numeric [0.22ms]
150 | 
151 | 		const value = await app
152 | 			.handle(req('/is-admin/true'))
153 | 			.then((x) => x.text())
154 | 
155 | 		expect(value).toBe('boolean')
                      ^
error: expect(received).toBe(expected)

Expected: "boolean"
Received: "string"

      at /Users/morse/Documents/GitHub/elysia/test/validator/params.test.ts:155:17
(fail) Params Validator > coerce string object to boolean [0.18ms]
(pass) Params Validator > create default value on optional params [0.02ms]

test/response/static.test.ts:
 7 | 	it('work', async () => {
 8 | 		const app = new Elysia().get('/', 'Static Content')
 9 | 
10 | 		const response = await app.handle(req('/')).then((x) => x.text())
11 | 
12 | 		expect(response).toBe('Static Content')
                        ^
error: expect(received).toBe(expected)

Expected: "Static Content"
Received: "handle is not a function. (In 'handle(context)', 'handle' is \"Static Content\")"

      at /Users/morse/Documents/GitHub/elysia/test/response/static.test.ts:12:20
(fail) Static Content > work [0.42ms]
(pass) Static Content > handle onRequest [0.04ms]
(pass) Static Content > inline life-cycle [0.09ms]
(pass) Static Content > mutate context [0.11ms]
53 | 			})
54 | 			.get('/', 'Static Content')
55 | 
56 | 		const headers = await app.handle(req('/')).then((x) => x.headers)
57 | 
58 | 		expect(headers.get('X-Powered-By')).toBe('Elysia')
                                           ^
error: expect(received).toBe(expected)

Expected: "Elysia"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/response/static.test.ts:58:39
(fail) Static Content > set default header [0.07ms]
68 | 			}
69 | 		})
70 | 
71 | 		const response = await app.handle(req('/')).then((x) => x.text())
72 | 
73 | 		expect(response).toBe('handled')
                        ^
error: expect(received).toBe(expected)

Expected: "handled"
Received: "error"

      at /Users/morse/Documents/GitHub/elysia/test/response/static.test.ts:73:20
(fail) Static Content > handle errror after routing [0.04ms]
(pass) Static Content > handle errror after routing [0.08ms]
(pass) Static Content > clone content [0.06ms]

test/response/headers.test.ts:
(pass) Response Headers > add response headers
(pass) Response Headers > add headers from hook [0.40ms]
(pass) Response Headers > add headers from plugin [0.09ms]
(pass) Response Headers > add headers to Response [0.06ms]
(pass) Response Headers > add status to Response [0.05ms]
69 | 			})
70 | 			.get('/', () => 'hi')
71 | 
72 | 		const headers = await app.handle(req('/')).then((x) => x.headers)
73 | 
74 | 		expect(headers.get('x-powered-by')).toBe('Elysia')
                                           ^
error: expect(received).toBe(expected)

Expected: "Elysia"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/response/headers.test.ts:74:39
(fail) Response Headers > create static header [0.06ms]
81 | 
82 | 		const app = new Elysia().use(plugin).get('/', () => 'hi')
83 | 
84 | 		const headers = await app.handle(req('/')).then((x) => x.headers)
85 | 
86 | 		expect(headers.get('x-powered-by')).toBe('Elysia')
                                           ^
error: expect(received).toBe(expected)

Expected: "Elysia"
Received: null

      at /Users/morse/Documents/GitHub/elysia/test/response/headers.test.ts:86:39
(fail) Response Headers > accept header from plugin [0.03ms]
It's recommended to use scoped instance with a prefix to prevent collision routing with other instance.
(pass) Response Headers > scoped headers [0.22ms]

test/response/redirect.test.ts:
(pass) Response Redirect > handle redirect [0.52ms]
(pass) Response Redirect > handle redirect status [0.42ms]
(pass) Response Redirect > add set.headers to redirect [0.04ms]
60 | 
61 | 		const { headers, status } = await app.handle(req('/'))
62 | 
63 | 		expect(status).toBe(302)
64 | 		// @ts-expect-error
65 | 		expect(headers.toJSON()).toEqual({
                                ^
error: expect(received).toEqual(expected)

  {
    location: "/skadi",
    "set-cookie": [
+     "name=a",
+     "name2=b"
-     "name=a; Path=/",
-     "name2=b; Path=/"
    ],
  }

- Expected  - 2
+ Received  + 2

      at /Users/morse/Documents/GitHub/elysia/test/response/redirect.test.ts:65:28
(fail) Response Redirect > set multiple cookie on redirect [0.34ms]

test/response/custom-response.test.ts:
(pass) Custom Response Type > returns custom response when set headers is not empty
(pass) Custom Response Type > returns custom response when set headers is empty [0.36ms]

test/response/stream.test.ts:
(pass) Stream > handle stream [26.41ms]
79 | 				const { promise, resolve } = Promise.withResolvers()
80 | 
81 | 				reader.read().then(function pump({ done, value }): unknown {
82 | 					if (done) return resolve(acc)
83 | 
84 | 					expect(value.toString()).toBe(expected.shift()!)
                                   ^
error: expect(received).toBe(expected)

Expected: undefined
Received: "c"

      at pump (/Users/morse/Documents/GitHub/elysia/test/response/stream.test.ts:84:31)
(fail) Stream > stop stream on canceled request [23.50ms]
(pass) Stream > mutate set before yield is called [0.04ms]
(pass) Stream > mutate set before yield is called [0.37ms]
(pass) Stream > async mutate set before yield is called [0.13ms]
(pass) Stream > return value if not yield [0.17ms]
(pass) Stream > return async value if not yield [0.13ms]
(pass) Stream > handle object and array [25.49ms]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant