Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prefer-called-with.md 998B

1234567891011121314151617181920212223242526272829303132
  1. # Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()` (`prefer-called-with`)
  2. The `toBeCalled()` matcher is used to assert that a mock function has been
  3. called one or more times, without checking the arguments passed. The assertion
  4. is stronger when arguments are also validated using the `toBeCalledWith()`
  5. matcher. When some arguments are difficult to check, using generic match like
  6. `expect.anything()` at least enforces number and position of arguments.
  7. This rule warns if the form without argument checking is used, except for `.not`
  8. enforcing a function has never been called.
  9. ## Rule details
  10. The following patterns are warnings:
  11. ```js
  12. expect(someFunction).toBeCalled();
  13. expect(someFunction).toHaveBeenCalled();
  14. ```
  15. The following patterns are not warnings:
  16. ```js
  17. expect(noArgsFunction).toBeCalledWith();
  18. expect(roughArgsFunction).toBeCalledWith(expect.anything(), expect.any(Date));
  19. expect(anyArgsFunction).toBeCalledTimes(1);
  20. expect(uncalledFunction).not.toBeCalled();
  21. ```