drashland / rhum

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

feat(v2): mock.expects(...).toBeCalledWith(...) #154

Closed crookse closed 2 years ago

crookse commented 2 years ago

Summary

What:

Add method to mocks where we can do the following:

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

mock.expects("someMethod").toBeCalled(1).toBeCalledWith("hello");

mock.verifyExpectations(); // Should verify the following:
// 1. someMethod() was called once
// 2. someMethod() was called with "hello". For example, someMethod("hello")

Why:

Users should be able to verify that a method was called with specific arguments to further verify correct behavior.

Acceptance Criteria

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