Mock method "returns" implementation is called twice #40
Closed
Description
I'm mocking a method that returns a Promise:
myMock.setup(x => x.method()).returns(() => Promise.reject(new Error("blah")));
I noticed that the "returns" implementation is executed twice even if "method" is called only once on the mock.
This should not be a problem normally, the issue is that in this particular case, the test runner is failing because it detects an unhandled promise rejection.
Is this a known behavior?
Metadata
Assignees
Labels
No labels