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.

no-alias-methods.md 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Disallow alias methods (`no-alias-methods`)
  2. Several Jest methods have alias names, such as `toThrow` having the alias of
  3. `toThrowError`. This rule ensures that only the canonical name as used in the
  4. Jest documentation is used in the code. This makes it easier to search for all
  5. occurrences of the method within code, and it ensures consistency among the
  6. method names used.
  7. ## Rule details
  8. This rule triggers a warning if the alias name, rather than the canonical name,
  9. of a method is used.
  10. ### Default configuration
  11. The following patterns are considered warnings:
  12. ```js
  13. expect(a).toBeCalled();
  14. expect(a).toBeCalledTimes();
  15. expect(a).toBeCalledWith();
  16. expect(a).lastCalledWith();
  17. expect(a).nthCalledWith();
  18. expect(a).toReturn();
  19. expect(a).toReturnTimes();
  20. expect(a).toReturnWith();
  21. expect(a).lastReturnedWith();
  22. expect(a).nthReturnedWith();
  23. expect(a).toThrowError();
  24. ```
  25. The following patterns are not considered warnings:
  26. ```js
  27. expect(a).toHaveBeenCalled();
  28. expect(a).toHaveBeenCalledTimes();
  29. expect(a).toHaveBeenCalledWith();
  30. expect(a).toHaveBeenLastCalledWith();
  31. expect(a).toHaveBeenNthCalledWith();
  32. expect(a).toHaveReturned();
  33. expect(a).toHaveReturnedTimes();
  34. expect(a).toHaveReturnedWith();
  35. expect(a).toHaveLastReturnedWith();
  36. expect(a).toHaveNthReturnedWith();
  37. expect(a).toThrow();
  38. ```