Guides/Tutorials  - 
 
Advanced Sinon.js tips: How to stub more complex objects (like DOM elements)
Several of my readers have emailed me, asking about how to deal with more complex stubbing situations when using Sinon.js. In this article, we'll look at how to stub objects which are deeply nested, and when functions have more complex return values and they interact with other objects.
3
1
Jani Hartikainen's profile photoPrateek Jadhwani's profile photo
3 comments
 
+Prateek Jadhwani Sure - if you have an object with some function in it, you can stub it :) You can for example stub out `el.createShadowRoot` in a similar way as shown in the article I linked
Add a comment...