-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Run the existing tests with deno #179
Conversation
|
Name | Link |
---|---|
🔨 Latest commit | f21e204 |
Thank you for your contribution! I will try to review your changes next week. |
Rebased now #178 is merged. The diff looks much cleaner now. |
Sorry for not responding to this PR for so long. Is the idea to also run all tests with Deno to detect possible problems in advance? |
No problem at all @fabian-hiller
Yes, exactly right. It looks like Valibot was initially compatible with Deno but at some point it was broken, we then fixed it in #178. I believe this PR would have prevented that initial break as well as the cause of #249 If you would be interested in progressing this PR then I would like to do a couple of things:
Please let me know so I know whether to proceed. |
I haven't made a decision yet, but I'm interested in this PR. Valibot seems to be one of the more popular packages with Deno, so it might make sense to make sure there are no problems here either when publishing a new version. |
I've been patching some missing behaviour but it looks like this is going to be hard migrate to until it supports asymmetric matchers. I'm just going to do the first two for now. |
The PR is in a good state to be merged, let me know if there's anything more you need from me. |
Thank you! I will review it in the coming week or the week after. |
3c31470
to
7fcaa83
Compare
b82a1a1
to
55828f5
Compare
Now you're publishing to jsr, is it a good time to revisit this 😉 😉 ? |
I am currently very focused on the source code and documentation. Once v1 is released I will have a look at this PR. |
Hey, since we are now publishing Valibot on JSR, it seems to me that this is no longer necessary. What do you think about it? |
A lot of this PR can be deleted and cleaned up because Vitest is now supported in deno. But JSR won't run your tests for you so I still think you should run tests on Deno in GitHub actions, even more so now you claim to support Deno in JSR. If you claim Valibot can run on Deno, then I recommend you run tests on Deno to verify that claim. Would you like me to have a go at a simplified PR that just uses Deno to run the tests as they are? No shims, and as few changes as possible. |
Yes, feel free to create a minimal PR. Thank you! |
41ae798
to
4a7ee57
Compare
7a97dd0
to
b5f7f4d
Compare
We may switch to Deno v2 in the long run. Should I close this issue? |
Yes please, I've become quite busy recently. Sorry for the delay. |
This PR builds on the existing deno fix #178 and adds some new checks to make sure deno support does not break in future. You can see the diff against the #178 changes here: syhol/valibot@main...syhol:valibot:deno-testsWhat does this PR do:
library/src/testUtils/denoVitestPolyfill.ts
:describe
andit
. This usesDeno.test
under the hood and I'm not sure how much API parity it has with vitest, but it at least providestest.skip(...)
,test.only(...)
,before*
andafter*
functions.expect
. This is the jest expect package because I can't get vitest expect to work for the same reason the vitest runner won't work; however, it should be API compatible as that's a design goal of vitest.library/deno.json
->imports
key: redirect import of vitest to instead use thedenoVitestPolyfill.ts
when run through the Deno runtime.src/comparison.ts
could be moved into this folder in a future PR.record.test.ts
andrecordAsync.test.ts
since unlike node, deno has no__proto__
property on objects.library/mod.test.ts
that just checks that mod.ts can be imported.What do we get out of this PR:
deno task test
in the library directory to execute all existing tests with Deno