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

Added SchemaCompiler, TypeProvider, and Logger to types. #225

Merged
merged 3 commits into from Oct 4, 2022

Conversation

teastman
Copy link
Contributor

#213

Fixed TypeProvider typings in its WebsocketHandler by adding SchemaCompiler, TypeProvider, and Logger. Attempted to mirror the style used in fastify route.d.ts.

@kibertoad
Copy link
Member

Thanks! Can you add tsd tests for this fix?

@teastman
Copy link
Contributor Author

For sure! Added.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kibertoad
Copy link
Member

tests are failing

@teastman
Copy link
Contributor Author

teastman commented Oct 2, 2022

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. (test/hooks.js:364:1)
Module.replacementCompile (node_modules/append-transform/index.js:60:13)
Object. (node_modules/append-transform/index.js:64:4)
`

@Uzlopak
Copy link
Contributor

Uzlopak commented Oct 4, 2022

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.

@Uzlopak Uzlopak merged commit 66b70eb into fastify:master Oct 4, 2022
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.

None yet

4 participants