Closed mmarchois closed 4 years ago
Hello @lordrip, any solution ? :pray: Thank you.
Fix my problem by using deepEqual :+1:
Sorry to necro this thread, but can you give some more details about how you used deepEqual to fix your problem?
@ianw11 & anyone else who will met such issue:
This code:
when(taskRepository.save(new Task('Task'))).thenResolve(
instance(createdTask) // This doesn't seems to work, in my handler i have a null instead of my object
);
Should compare input args with deepEqual
:
import { deepEqual } from 'ts-mockito'
// ...
when(taskRepository.save(deepEqual( new Task('Task') ))).thenResolve(
instance(createdTask)
);
Hi,
I have an error when i try to put an instance of mock inside a
thenResolve
method.Here is my class :
Here is my complete test :
Here my TaskRepository (using typeorm) :
Any idea ?