dwyl / apprenticeship

🌱 Everything you need to know about the @dwyl Apprenticeship in Creative Technologies (ACT)
GNU General Public License v2.0
17 stars 1 forks source link

Learn basics of Sinon #14

Open ZooeyMiller opened 7 years ago

ZooeyMiller commented 7 years ago

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.)

finnhodgkin commented 7 years ago

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

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

ZooeyMiller commented 7 years ago

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 commented 7 years ago

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