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

Load Jquery Into Mocha Test For React App

I've created a Mocha test setup similar to this tutorial outlined here: https://github.com/jess… Read more Load Jquery Into Mocha Test For React App

Undefined|0|referenceerror: Strict Mode Forbids Implicit Creation Of Global Property 'csrf_token'

So, this was quite an interesting problem I have been running into. I am currently building a backb… Read more Undefined|0|referenceerror: Strict Mode Forbids Implicit Creation Of Global Property 'csrf_token'

Test Simple Logger Functions With Full Code Coverage

I'm using Chai, Sinon and Instanbul to test a NodeJS application. Here's the Logger code: i… Read more Test Simple Logger Functions With Full Code Coverage

Sinon - How To Stub Authentication Library (authy -twilio)

I am currently new to Sinon, Mocha, Supertest and in the process to writes tests. In my current sce… Read more Sinon - How To Stub Authentication Library (authy -twilio)

Sinon - Stubbing Function With Callback - Causing Test Method To Timeout

I have a method on a express route that looks like this: exports.register_post = function(req, res)… Read more Sinon - Stubbing Function With Callback - Causing Test Method To Timeout

Simple Way To Test Middleware In Express Without Creating Recreating Server?

I'd like to be able to stub my middleware functions on a per-test basis. The problem, as articu… Read more Simple Way To Test Middleware In Express Without Creating Recreating Server?

Stub Save Instance Method Of Mongoose Model With Sinon

I am trying to test a service function I use to save a widget using a Mongoose model. I want to stu… Read more Stub Save Instance Method Of Mongoose Model With Sinon

Test Node-schedule With Sinon FakeTimers

I want to test my scheduleJob from the node-schedule package. With sinon useFakeTimers() i can skip… Read more Test Node-schedule With Sinon FakeTimers