Sinon Questions

Ad

Mocking 'os' nodejs module issues

I'm currently facing some difficulties mocking the 'os' module in nodejs. i'd like to mock the 'networkinterfaces' function of the module to
Ad

How to mock events with sinon?

Here is my simple program where i'm trying to get user's data via ldapclient. i need to test it without internet connection so wondering how to
Ad

Stubbing Out Middleware

I'm trying to use sinon to stub out some custom middleware in an express route but it's not working as i expect it to. i expect it to not log "i
Ad
Ad

Spy on imported function

I want to spy on a function that is executed as soon as the file is required. in the example below i want to spy on bar. i have the following
Ad

Can't decide how to test this code

I am attempting to write a test for the following code using mocha, chai, chai as promised & sinon but i am not too familiar with testing and
Ad
Ad
Ad
Ad

Blog Categories

Ad