My code is as below ->
let mockFunction = jest.fn().mockImplementation((a) => {
this.temp = a;
});
When I instantiate this function as follows
let mockFn = new mockFunction(6);
console.log(mockFn.temp) //this gives me undefined instead of 6
How can I access the instance in the mockImplementation function?
Aucun commentaire:
Enregistrer un commentaire