apprenticeship icon indicating copy to clipboard operation
apprenticeship copied to clipboard

Learn basics of Sinon

Open ZooeyMiller opened this issue 7 years ago • 3 comments

For https://github.com/dwyl/apprenticeship/issues/13#issuecomment-314721760 we need to learn the basics of Sinon.

After a discussion re time estimates @sohilpandya we are going to spend the rest of today on this, to make sure we have a reasonable understanding of it. (we feel this is a prerequisite for working with aws-sdk-mock, and are still awaiting verification for SES so are blocked from working on that at the moment.)

ZooeyMiller avatar Jul 12 '17 11:07 ZooeyMiller

I've created a learn-sinon repo that we can add our learnings to:

https://github.com/finnhodgkin/learn-sinon

finnhodgkin avatar Jul 12 '17 13:07 finnhodgkin

We're working on making an example for learn-sinon but finding it hard to think of relevant real world style applications of sinon. (not saying they are not a thing, but just while we're on the spot I can't think of one)

ZooeyMiller avatar Jul 12 '17 13:07 ZooeyMiller

We've made an example of stubbing in tests, we skipped over spies to start with as stubs seems like they needed more time.

We learned the difference between stub.restore(), stub.reset() and stub.restoreDefault() which was super helpful.

we haven't added mocks as we couldn't visualise a use case that we could test, but I feel we understand the basics of sinon which is awesome :+1:

results of which are in www.github.com/finnhodgkin/learn-sinon

ZooeyMiller avatar Jul 12 '17 16:07 ZooeyMiller

Closing as complete. ✅

nelsonic avatar Oct 02 '24 11:10 nelsonic