Category "sinon"

FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app) - when using sinon

I have a NodeJS application and I'm trying to write some tests. Currently, I'm trying to stub Firebase. Current code: sinon.stub(firebase, 'initializeApp'); con

Sinon.js combining calledWith number of times

I know with sinon.js you can test that a spy was called a certain number of times: sinon.assert.calledTwice(mySpy.someMethod); And you can test that a spy wa

Sinon.js combining calledWith number of times

I know with sinon.js you can test that a spy was called a certain number of times: sinon.assert.calledTwice(mySpy.someMethod); And you can test that a spy wa

How to do Parameter Validation while using aws-sdk-mock

I am using aws-sdk-mock with Jest for testing AWS Lamda. My lambda uses AWS Polly Service to convert text to speech. Following is the piece of code which I want

Sinon Spy / Stub for Function inside Function (Private Function)

I'm new Sinon. i'm unable to spy the private ajax function Actual code in library.js function ajax () { console.log("I'm a"); } function getJSON() {

Unit testing for Google Cloud Functions

I was trying to write unit testing for Google Cloud Functions referring to Google Cloud Platform unit testing docs but not able to understand how to mock when G

Calling original function from Sinon.js Stub

I'm trying to intercept a call with Sinon.js so I can do some logging and then execute the original call. I don't see a way to do this with sinon.spy(), but I