0

I have a nested object ->

let somevar = {
    read : () => {
        return {
            fetchsomething : () => {
                somemodule.methodName(params, cb (err,data) {
                    if(err){
                        //reject promise
                    }
                    else {
                        //resolve promise
                    }
                });
                //return promise obj
            }
        }
    }   
};

Now i want to stub 'methodName' and not able to do so. Have tried returning it on the stub, but not sure whats the right thing to do.

user4387602
  • 103
  • 1
  • 1
  • 7

0 Answers0