ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Swap to sinon stub from homerolled fakeConfig #328

Closed ryanluker closed 3 years ago

ryanluker commented 3 years ago

Description

Finished part 3 of #321 to use sinon instead of the manual fake. Along with removing the old exportAPI test helper. cc @mattseddon

Design

Originally I was thinking of using sinon mocks but after reading though the documentation [1] it appears that these are more correctly called stubs in sinon land, heh [2].

I also turfed the exportAPI helpers for the extension tests and adopted the sinon spy instead [3], pretty happy with the results!

Work

Research

  1. https://sinonjs.org/releases/v11.1.1/mocks/#when-to-not-use-mocks
  2. https://sinonjs.org/releases/v11.1.1/stubs/#when-to-use-stubs
  3. https://sinonjs.org/releases/v11.1.1/spies/#using-a-spy-to-wrap-all-object-method
  4. https://stackoverflow.com/a/38152098
ryanluker commented 3 years ago

@mattseddon thanks for the feedback!