Top "Sinon" questions

Sinon is a mocking framework for JavaScript, which can create spies, stubs and mocks.

Sinon.Stub in Node with AWS-SDK

I am trying to write some test coverage for an app that uses the aws-sdk NPM module that pushes things …

node.js sinon aws-sdk
Creating request stub with sinon in mocha

I'm using mocha to test some classes and I need to create a stub of request library. I'm using sinon, …

node.js mocha sinon
Stubbing window functions in Jest

In my code, I trigger a callback upon "OK" click of a window.confirm prompt, and I want to test …

javascript sinon jestjs
How to test multiple calls to the same function with different params?

Supose I have a function like this: function foo () { obj.method(1); obj.method(2); obj.method(3); } To test it I want …

javascript unit-testing sinon
Failing test displays "Error: timeout of 2000ms exceeded" when using Sinon-Chai

I have the following route (express) for which I'm writing an integration test. Here's the code: var q = require("q"), …

node.js unit-testing mocha sinon chai
Stub out module function

Edit: Being a little bit more precise. I want to test usecases for a Github API wrapper extension, that our …

javascript node.js sinon
Stubbing a Mongoose model with Sinon

I want to create a stub for the Mongoose save method in a particular model, so that any instance of …

node.js mongoose sinon
Testing changes to React component state and spying on instance methods using enzyme

I am working on a wrapper component for smoothly loading images in React. I use enzyme with mocha, chai and …

javascript reactjs sinon enzyme chai-enzyme
ES2016 Class, Sinon Stub Constructor

I'm trying to stub out a super call with sinon, and es2016 but I'm not having much luck. Any ideas …

javascript node.js mocha sinon babeljs
Sinon.JS - How can I get arguments from a stub?

I am trying to use Sinon to test a JS component which looks a bit like this... import Bootbox from "../…

javascript sinon sinon-chai