Migrate type tests to Vitest
This PR:
- [X] Converts
typetest.tsfile extensions totest-d.tsto be compatible with Vitest. - [X] Converts
expectType()to eitherassertType()orexpectTypeOf().toMatchTypeOf(). - [X] Converts
expectExactTypetoexpectTypeOf().toEqualTypeOf(). - [X] Converts lone-blocks to
testordescribeblocks.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Deploy Preview for react-redux-docs ready!
| Name | Link |
|---|---|
| Latest commit | d69e108d827dac3ef5fe2fad7eb1901c1e1bd2dd |
| Latest deploy log | https://app.netlify.com/sites/react-redux-docs/deploys/661276573120920008cb9427 |
| Deploy Preview | https://deploy-preview-2129--react-redux-docs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Haven't paid any attention to this, I'm afraid :) Where's it stand? I see green.
Also, just out of curiosity, what's the net benefit of doing typetests with Vitest?
@markerikson All tests are passing.
Also, just out of curiosity, what's the net benefit of doing typetests with Vitest?
- Type tests become more semantic and easier to read.
- We can take advantage of the type checking utilities Vitest provides.
- We can use the
.skip/.only/.todosyntax. - We can run both runtime and type tests by using the
--typecheckflag.
On a side note I'm also a collaborator on the expect-type which is the library Vitest uses for type checking.
Okay, cloned it briefly and confirmed A) it passes locally, B) it does catch errors if I introduce them. Nice!