Closed teastman closed 2 years ago
Thanks! Can you add tsd tests for this fix?
For sure! Added.
tests are failing
Well that's super embarrassing, I've fixed them.
Semi-related question. Does the last test in hooks.js fail on your local machine on a fresh master branch pull? I can clearly see it's not failing in the CI, but on a completely fresh clone it's only calling 5 t assertions but starts with t.plan(6). It looks like the t.fail() inside the fastify.get(...) never gets called.
` FAIL test/hooks.js ✖ test unfinished
test/hooks.js
362 | })
363 |
364 | test('Should not hijack reply for an WS request to a WS route that gets sent a normal HTTP response in a hook', t => {
| ^
365 | t.plan(6)
366 | const stream = split(JSON.parse)
367 | const fastify = Fastify({ logger: { stream } })
test: Should not hijack reply for an WS request to a WS route that gets sent a
normal HTTP response in a hook
stack: |
Object.
t.fail is the bailout. If you hit t.fail then your test failed. So it is correct that the count is lower, because you dont want to hit the t.fail anyway.
https://github.com/fastify/fastify-websocket/issues/213
Fixed TypeProvider typings in its WebsocketHandler by adding SchemaCompiler, TypeProvider, and Logger. Attempted to mirror the style used in fastify route.d.ts.