-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bug]: Regression in V28: [email protected] types toHaveBeenCalledWith forcing at least one argument. #12804
Comments
Trying to understand. Do you mean: types should allow a case there a mock was called with no arguments? For example: import { describe, expect, test, jest } from "@jest/globals";
const mockFn = jest.fn();
test("toHaveBeenCalled", () => {
mockFn();
mockFn(123);
expect(mockFn).toHaveBeenCalledTimes(2);
expect(mockFn).toHaveBeenCalledWith();
expect(mockFn).toHaveBeenCalledWith(123);
}); |
Exactly, that was allowed in Sorry if the tittle is not the best one, feel free to update it :) |
Makes sense to me for args to be optional 👍 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
28.0.3
Steps to reproduce
Expected behavior
Typescript should compile with no errors
Actual behavior
The following error is thrown:
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: