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
Remove test
import in README.md
#65
Conversation
Technically this is correct. Did you notice that Another aspect: having Vitest import means that |
Another limitation of Recently I saw if ('when foo and bar are imported') {
// make sure `foo` has type {a: number}
expectTypeOf(foo).toMatchTypeOf<{a: number}>()
// make sure `bar` is a function taking a string:
expectTypeOf(bar).parameter(0).toBeString()
expectTypeOf(bar).returns.not.toBeAny()
}) It has no |
The scope of this library is test assertions, not to be a test runner. So no need to define a The example in question here is just that... an example. It's to give readers an idea of what they need to do to test their types. As for performance, test.skip etc. Those are reasonable points and I think a good enough reason to remove the Having said all that, if we remove the test wrapper from the first example, it might be nice to have a "Usage with test frameworks" section with some recommendations. |
Thanks for detailed explanation.
|
Sorry about making noise here. What about documenting the above? This would explain / resolve #55 and likely #64 as well. But documenting this behaviour will conflict with other parts of documentation, like: "first-class support for: Also "make sure" in the following is misguiding, because Lines 15 to 16 in 9cda9e0
|
Yes, some clarification needed, how it was intended: toEqualTypeOf: protects against any, lets you assert an exact type In practice, though, you're right that very few people will want an |
Update: I thought a bit more, and I am struggling to think of any good/practical use for having assertions like FYI @mrazauskas |
I used With
Replacing the import with
Yep, |
test
import in README.md
test
import in README.md
@mmkal I removed the |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [expect-type](https://togithub.com/mmkal/expect-type) | [`0.18.0` -> `0.19.0`](https://renovatebot.com/diffs/npm/expect-type/0.18.0/0.19.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/expect-type/0.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/expect-type/0.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/expect-type/0.18.0/0.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/expect-type/0.18.0/0.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mmkal/expect-type (expect-type)</summary> ### [`v0.19.0`](https://togithub.com/mmkal/expect-type/releases/tag/0.19.0) [Compare Source](https://togithub.com/mmkal/expect-type/compare/0.18.0...0.19.0) #### What's Changed - Fix `.omit()` to work similarly to `Omit` by [@​aryaemami59](https://togithub.com/aryaemami59) in [mmkal/expect-type#54 - Add JSDocs to everything by [@​aryaemami59](https://togithub.com/aryaemami59) in [mmkal/expect-type#56 - Remove `test` import in `README.md` by [@​aryaemami59](https://togithub.com/aryaemami59) in [mmkal/expect-type#65 **Full Changelog**: mmkal/expect-type@0.18.0...0.19.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
This PR:
test()
helper #63.