skovhus / jest-codemods

Codemods for migrating to Jest https://github.com/facebook/jest 👾
MIT License
878 stars 81 forks source link

sinon: add support for sinon.assert #518

Closed kristerkari closed 1 year ago

kristerkari commented 1 year ago

Attempts to implement most of the sinon.assert matchers in the sinon codemod.

If you have any idea of how to implement more of the sinon.assert matchers, please let me know. Also, the switch statement that I used is not the prettiest one, but at least it is relatively easy to read (suggestions welcome there too).

I used these as documentation for how sinon.assert is used:

ping @skovhus

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.09 :tada:

Comparison is base (a94e2b5) 92.38% compared to head (ecd7076) 92.47%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #518 +/- ## ========================================== + Coverage 92.38% 92.47% +0.09% ========================================== Files 26 26 Lines 1944 1968 +24 Branches 405 407 +2 ========================================== + Hits 1796 1820 +24 Misses 102 102 Partials 46 46 ``` | [Impacted Files](https://codecov.io/gh/skovhus/jest-codemods/pull/518?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kenneth+Skovhus) | Coverage Δ | | |---|---|---| | [src/transformers/sinon.ts](https://codecov.io/gh/skovhus/jest-codemods/pull/518?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kenneth+Skovhus#diff-c3JjL3RyYW5zZm9ybWVycy9zaW5vbi50cw==) | `91.47% <100.00%> (+0.72%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kenneth+Skovhus). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kenneth+Skovhus)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

skovhus commented 1 year ago

Thanks!