Solid-testing library TS-eslint-errors
Hey<
I am just starting out using solids testing library and setup my project according to this example: https://github.com/solidjs/solid-start/tree/main/examples/with-vitest/src
However I am getting some TS-errors I am not quite sure how to resolve correctly.
My
Counter.test.tsx
looks exactly like in the example:
However on the destructor of queryByRole
I receive the following error:
Furhtermore on the call to queryByRole
I receive an error, that queryByRole does not return a Promise and is therefore not awaitable.
Is this an error on my part or is this an error already present inside the example repo?
Thanks in advanceGitHub
solid-start/examples/with-vitest/src at main · solidjs/solid-start
SolidStart, the Solid app framework. Contribute to solidjs/solid-start development by creating an account on GitHub.
9 Replies
If you want an asynchronous query, you need
findByRole
. And I don't think you should apply your linter settings on your dependencies.
Unfortunately, I cannot change the types of the queries, since those are coming directly from testing-library/dom
, so you really need to fix the linter error on your side.Ah I see, thanks for the super quick response. I didn't change the code from the example - so the with-vitest-example inside the solid-start repo seems to be incorrectly trying to await
getByRole
here.
Anyway, I am going to try to turn off these linter errors for deps. Thanks again! 🙂Thanks for the information, I'll correct the example.
@lexlohr I am running into weird issues when calling vitest with
run
. Apparently there are hanging processes. I don't seem to have these in projects without solid(-start). Do you have an idea what could cause this? Checking with the hanging-process-reporter, I get modstly node:internal/async_hooks
-Filehandles. I am not quite sure how to continue to debug this.Which versions of solid-start and node js are you using?
node 19.8.1 and solid-start 0.2.26
Okay, nothing that would be obviously problematic. I'll have to investigate more. This will take some time.
Thanks a ton for your effort! Let me know if you need anthing to help further debug this 🙂
Will do.