drashland / rhum

A test double library
https://drash.land/rhum
MIT License
92 stars 6 forks source link

feat: mock.toBeCalledWithArgs(...) #166

Open crookse opened 2 years ago

crookse commented 2 years ago

Summary

What:

Spies have .verify(...).toBeCalledWithArgs(...). Mocks should use this logic in the .expects(...) method chaining.

Why:

Would be nice to create an expectation on a mock that a method was called with args.

Acceptance Criteria

Below is a list of tasks that must be completed before this issue can be closed.

Example Pseudo Code (for implementation)

const mock = Mock(...).create();

mock.expects("someMethod").toBeCalledWithArgs(...);

mock.verifyExpectations();
crookse commented 2 years ago

i still need to document this