-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"times" seems superfluous #343
Comments
@Jameskmonger yeah, let's have this as a discussion task to find a way to implement the current functionality. This will have to go in > 2.0.0 as it's an API change 👍 |
I think the above syntax is good for |
I think we should probably leave the Will need a bit more thought for Probably the neatest I can think of now is similar to how it is now. Expect(some.function).toHaveBeenCalledWith().exactly.times(4);
Expect(some.function).toHaveBeenCalledWith().atLeast.times(4);
Expect(some.function).toHaveBeenCalledWith().atMost.times(4);
Expect(some.function).toHaveBeenCalledWith("some", "arguments").exactly.times(4);
Expect(some.function).toHaveBeenCalledWith("some", "arguments").atLeast.times(4);
Expect(some.function).toHaveBeenCalledWith("some", "arguments").atMost.times(4); |
Perfect, that looks good to me @jamesrichford. |
Another thought on this one @Jameskmonger maybe we should remove the extra dot chain i.e. Expect(some.function).toHaveBeenCalledWith().exactlyTimes(4);
Expect(some.function).toHaveBeenCalledWith().atLeastTimes(4);
Expect(some.function).toHaveBeenCalledWith().atMostTimes(4);
Expect(some.function).toHaveBeenCalledWith("some", "arguments").exactlyTimes(4);
Expect(some.function).toHaveBeenCalledWith("some", "arguments").atLeastTimes(4);
Expect(some.function).toHaveBeenCalledWith("some", "arguments").atMostTimes(4); |
Potentially we could, but I think it may fit well with our |
@Jameskmonger where would the |
The
times
property inExpect(some.function).toHaveBeenCalled(3).times
seems very unnecessary. I think that as a library we should be encouraging good, clean code - not using variables which don't do anything but increase readability.I find it to be slightly confusing if I don't understand the library - why is someone using a variable as a statement?
If you want to keep a syntax, maybe we could do something like FakeItEasy:
The text was updated successfully, but these errors were encountered: