I am trying testing on node js I want to mock a variable outside of a function that is going to be unit tested. for example
const sample = [];
function uploadDoc {
sample.push('fileLocation')
}
function toSave(){
for (i=0;i<sample.length;i++)
**some process read and access doc
}
I am facing issue while unit testing the second function I have tried rewire npm that is also not working
Aucun commentaire:
Enregistrer un commentaire