Top "Sinon" questions

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

sinon not stubbing property value

I am using sinon v4.1.2. According to the documentation (http://sinonjs.org/releases/v4.1.2/sandbox/), I should be able to …

sinon stub
Sinon stub callsFake argument

I had the following stubs running perfectly before sinon.stub(console, 'log', () => { // Check what the arguments holds // And either …

javascript sinon
Proxyquire, rewire, SandboxedModule, and Sinon: pros & cons

When mocking Node dependencies, I've happened upon the following libraries: Proxyquire Rewire SandboxedModule Sinon They all seem to do more-or-less …

node.js mocking sinon proxyquire
TypeError: 'undefined' is not a function (evaluating 'sinon.spy()')

I'm trying to use sinon.js in testing of a backbone application. But unfortunately I cannot use spy method due …

javascript backbone.js sinon
Node Express testing mock res.status(status).json(obj)

I get the following error when trying to test my method: TypeError: Cannot call method 'json' of undefined Below is …

node.js express mocha sinon
Stub moment.js constructor with Sinon

I am not able to stub the moment constructor when calling it with the format function to return a pre-defined …

mocha momentjs sinon chai
Writing unit tests for method that uses jwt token in javascript

I have been trying to write unit test in javascript for the method which uses jwt token validation. So the …

javascript unit-testing jwt sinon ava
Files upload testing in Enzyme

I have a FileInput in my render function <FileInput accept= "image/jpeg,image/png,audio/mp3" onChange= {this.fileInputOnChange} …

reactjs mocha sinon chai enzyme
Stubbing a prototype method with sinon

Let's say I have the following methods: Controller.prototype.refresh = function () { console.log('refreshing'); } Controller.prototype.delete = function (object) { var …

javascript prototype mocha.js sinon stubs
Sinon.JS stub for window.location.search

I am trying to test a simple function that makes a call to window.location.search. I'm trying to understand …

coffeescript stubbing sinon buster.js