After going through all related issues regarding stubbing readFile/Sync with Sinon /Chai/ Mocha, the test is failing. There's a basic getFile functio ...
After going through all related issues regarding stubbing readFile/Sync with Sinon /Chai/ Mocha, the test is failing. There's a basic getFile functio ...
I am writing a Cypress integration test for a Google Optimize experiment and I would like to stub the experiment variant value provided by gtag librar ...
Working on project that uses a STOMP library called stompit. Had to make a change that adds the onReceipt callback which is provided via options param ...
I have a code snippet for which I have to increase code coverage Following is my controller- I need to have statements in my qunit for the bold secti ...
I am trying to write test cases for an Node.js backend project The database is using pg-promise. I run into issue when trying to stub the repository a ...
so npm audit just found jsonwebtoken to have a security vulnerbility. The solution is to update to version 9.0.0 - which I did. However, my mocha tes ...
I'm trying to avoid use of older Sinon APIs and use Fakes only. Previously, I used to be able to mock the return value of a stub based on an argument ...
I have code in which I make a call to elasticsearch indices stats. Tried mocking it following way but did not work. The error I get is TypeError: C ...
Let's say I have the following route: And then I write a test like so: This fails with: Through console.logs, I have verified the following: ...
I have the following code to try and stub out the Auth0 Management API function... I tried using the star syntax but it doesn't work and I am not s ...
I'm trying to follow the guide here to test an emitted event. Given the following Vue SFC: and the following Cypress test: My test is failing w ...
I have an emberjs file (child.js) that extends from an Abstract js file (Parent.js) Inside the parent component we have the boolean property set as ...
. Answers to this question are eligible for a +50 reputation bounty. lh ...
I tried to use the code below but keeps on telling me Cannot stub non-existent property query is there a way to stub sequelize query? all I find in t ...
sinon.stub doesnt work... So I installed sinon and I try to stub an object's method with fake arguments. But after the stub Im calling the object's m ...
I have a file named index.js I want to write unit test case, where i can actually stub the main method using sinon. For this i created a testfile n ...
When I call an API to make a delete request, it returns {} as request.body.result. I need to assert that the returned value {} is equal to my MOCK_RES ...
I am trying to stub the following method in my unit test suite - This is my unit test stub - I am getting this compilation error when trying to ...
I want to test a class, which contains a private function (Bar), which is called from setInterval. This private function is async and requires a sleep ...
Hi I am using sequelize ORM with Postgres database for this node.js express.js app. As for testing I am using mocha, chai and sinon. I am trying to c ...