reduxjs / react-redux

Official React bindings for Redux
https://react-redux.js.org
MIT License
23.27k stars 3.36k forks source link

Migrate type tests to Vitest #2129

Closed aryaemami59 closed 3 weeks ago

aryaemami59 commented 3 months ago

This PR:

codesandbox-ci[bot] commented 3 months ago

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.

netlify[bot] commented 2 months ago

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

markerikson commented 1 month ago

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?

aryaemami59 commented 1 month ago

@markerikson All tests are passing.

Also, just out of curiosity, what's the net benefit of doing typetests with Vitest?

  1. Type tests become more semantic and easier to read.
  2. We can take advantage of the type checking utilities Vitest provides.
  3. We can use the .skip/.only/.todo syntax.
  4. We can run both runtime and type tests by using the --typecheck flag.

On a side note I'm also a collaborator on the expect-type which is the library Vitest uses for type checking.

markerikson commented 3 weeks ago

Okay, cloned it briefly and confirmed A) it passes locally, B) it does catch errors if I introduce them. Nice!