ezolenko / rollup-plugin-typescript2

Rollup plugin for typescript with compiler errors.
MIT License
820 stars 71 forks source link

refactor(test): heavily simplify the `context` helper #404

Closed agilgur5 closed 2 years ago

agilgur5 commented 2 years ago

~NOTE: this is built on top of #397 as that also uses the context helper. It may also merge conflict with #396 if that is merged. As such, I've marked this PR as "Draft" until those PRs are merged (or otherwise closed).~ Rebased on top, fixed merge conflicts, and marked as ready for review.

Summary

Significantly simplify the context helper used in the unit tests with more forceful type-casting and directly using Jest mocks. This makes all usage of context significantly easier and less hacky, as can be seen in the changed tests here.

Details