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-restricted-matchers.md 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Disallow specific matchers & modifiers (`no-restricted-matchers`)
  2. This rule bans specific matchers & modifiers from being used, and can suggest
  3. alternatives.
  4. ## Rule Details
  5. Bans are expressed in the form of a map, with the value being either a string
  6. message to be shown, or `null` if the default rule message should be used.
  7. Both matchers, modifiers, and chains of the two are checked, allowing for
  8. specific variations of a matcher to be banned if desired.
  9. By default, this map is empty, meaning no matchers or modifiers are banned.
  10. For example:
  11. ```json
  12. {
  13. "jest/no-restricted-matchers": [
  14. "error",
  15. {
  16. "toBeFalsy": null,
  17. "resolves": "Use `expect(await promise)` instead.",
  18. "not.toHaveBeenCalledWith": null
  19. }
  20. ]
  21. }
  22. ```
  23. Examples of **incorrect** code for this rule with the above configuration
  24. ```js
  25. it('is false', () => {
  26. expect(a).toBeFalsy();
  27. });
  28. it('resolves', async () => {
  29. await expect(myPromise()).resolves.toBe(true);
  30. });
  31. describe('when an error happens', () => {
  32. it('does not upload the file', async () => {
  33. expect(uploadFileMock).not.toHaveBeenCalledWith('file.name');
  34. });
  35. });
  36. ```