Skip to content

Instantly share code, notes, and snippets.

@fatso83
Last active September 6, 2018 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatso83/57d445b5a548948784d5aa592ca7dee0 to your computer and use it in GitHub Desktop.
Save fatso83/57d445b5a548948784d5aa592ca7dee0 to your computer and use it in GitHub Desktop.
Sinon issues I would like to tackle in time to remove confusion

Create an article on how ES2015 classes relate to stubbing/spying

sinonjs/sinon#1121

Show how to stub ES6 constructor #1265

sinonjs/sinon#1265 What: Feature request to automatically call stubbed/spied constructors with new. Why: Often asked for. People get confused about Function#constructor and the constructor keyword. Should either make a small tutorial to document how to "stub" (make a new) constructor and/or introduce a small Sinon NPM plugin to do so (in the article).

ES6 classes and stubbing out dependencies using proxyquire

sinonjs/sinon#831 (comment) https://gist.github.com/fatso83/329da40002d45533b1e74db825f2bf54 What: how to use proxyquire to intercept dependencies Why: often asked for

Document how to configure Node to allow stubbing EcmaScript modules #1832

sinonjs/sinon#1832 Why: Often asked for. Needs extra tools (esm).

Stubbing instance methods

sinonjs/sinon#878 (comment)

Cannot stub arrow function in a class #1136

sinonjs/sinon#1136 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment