MetaMask / snaps-cli

A CLI for developing MetaMask plugins.
ISC License
37 stars 26 forks source link

Colocate tests and migrate them to TypeScript #106

Closed rekmarks closed 3 years ago

rekmarks commented 3 years ago

I was looking into improving test coverage to >=95% by all instanbul measures, and felt unhappy about how much the snaps-cli tests diverge from our existing standards. Therefore, I decided to convert them to TypeScript and colocate them with the source files.

I took care to modify the test files as little as possible, but some modifications were unavoidable. The only gratuitous modification I made was to pull out some repeatedly declared mocks into equivalent factory functions.

Comparing coverage results between this branch and main, coverage is identical.

Changes, in detail:

Ref: #74

shanejonas commented 3 years ago

looks good 👀