Skip to content Skip to sidebar Skip to footer
Showing posts with the label Sinon

How Does One Stub Promise With Sinon?

I have a data service with following function function getInsureds(searchCriteria) { var defer… Read more How Does One Stub Promise With Sinon?

Sinon Spy On Function Not Working

I'm trying to write a standalone test for this simple middleware function function onlyInternal… Read more Sinon Spy On Function Not Working

Stubbing Window.location.href With Sinon

I am trying to test some client-side code and for that I need to stub the value of window.location.… Read more Stubbing Window.location.href With Sinon

Spying On Date Constructor With Sinon

I have a method that sets expiration date of a token: var jwt = require('jwt-simple'); modu… Read more Spying On Date Constructor With Sinon

Stubbing Redis Interactions In Javascript Using Sinon

I am working in node.js. My app interacts with Redis via the node_redis module. I'm using moch… Read more Stubbing Redis Interactions In Javascript Using Sinon

Sinon Stub With Es6-promisified Object

Ok my setup is as follows: Using node 6.2, es6-promisify, sinon, sinon-as-promised, and babel to tr… Read more Sinon Stub With Es6-promisified Object

How Do I Assert Against Objects With Spies In Cypress?

I am using Cypress spies to test client-side analytics. My intent in this test is to confirm that … Read more How Do I Assert Against Objects With Spies In Cypress?

Sinon Clock.tick Doesn't Advance Time For Settimeout

I am writing a test for an async function which performs a series of tasks and at one point waits f… Read more Sinon Clock.tick Doesn't Advance Time For Settimeout