jeudi 18 avril 2019

How to mock non class member function using sinon

class ServiceClass {

async method1(){

}

}

async function method2(){ }

module.exports = ServiceClass;

i need to add mock to the method2 function. but i am getting "TypeError: Attempted to wrap undefined property method2 as function" error.

Aucun commentaire:

Enregistrer un commentaire