Closed Manvityagi closed 3 years ago
Hi, I have never done unit-testing in NodeJS but would love to explore the opportunity if given a chance. Since the issue is opened please allow me to take up the oppurtunity.
Hi, I have never done unit-testing in NodeJS but would love to explore the opportunity if given a chance. Since the issue is opened please allow me to take up the oppurtunity.
Hi @Athira2199, there is an issue assigned to you already, only 1 issue can be assigned at one time. Please complete that first
@Manvityagi I would like to work on this, Please Assign this to me
@Manvityagi I would like to work on this, Please Assign this to me
Assigned @Sukriti-sood, Go ahead. Feel free to ping on discord channel #opportunity-calendar-backend in case of any doubts.
@Manvityagi I have written tests for manager and services facing problem in controllers like how to compare status code and json data.
@Manvityagi I have written tests for manager and services facing problem in controllers like how to compare status code and json data.
Let's connect after Holi @Sukriti-sood
@Sukriti-sood
In this article, Refer to the last part- UserContoller class
, you will get a fair enough idea of how to write tests for our controllers.
https://blog.logrocket.com/unit-testing-node-js-applications-using-mocha-chai-and-sinon/
If you still face any problems, feel free to ping.
@Sukriti-sood Any updates?
@Sukriti-sood Any updates?
I have wriitten tests for manager and services and I am getting some errors while running tests related to require
Require Reference not found ESM modeule, Trying to resolve them ,
I will try to complete this issue today.
@Manvityagi Please help me I am continuously getting this Error Earlier I was writing test in develop branch then I realised I haven't created Feature branch from that time I am getting this Error
@Manvityagi Please help me I am continuously getting this Error Earlier I was writing test in develop branch then I realised I haven't created Feature branch from that time I am getting this Error
Try using import
in place of require
import chai from 'chai';
import sinon from 'sinon';
import stubValue from './fakedata';
//same for all other `require`
@Manvityagi Please help me I am continuously getting this Error Earlier I was writing test in develop branch then I realised I haven't created Feature branch from that time I am getting this Error
@Sukriti-sood Try using
import
in place ofrequire
import chai from 'chai'; import sinon from 'sinon'; import stubValue from './fakedata'; //same for all other `require`
@Manvityagi Please help me I am continuously getting this Error Earlier I was writing test in develop branch then I realised I haven't created Feature branch from that time I am getting this Error
Try using
import
in place ofrequire
import chai from 'chai'; import sinon from 'sinon'; import stubValue from './fakedata'; //same for all other `require`
I have tried this also for this I am getting module not defined
Can you pull the latest changes from repo and make a PR as it is.. So that I can debug on my system? @Sukriti-sood
Will update you soon on it @Sukriti-sood