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-inline-snapshots.md 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Suggest using inline snapshots (`prefer-inline-snapshots`)
  2. ## Deprecated
  3. This rule has been deprecated in favor of
  4. [`no-restricted-matchers`](no-restricted-matchers.md) with the following config:
  5. ```json
  6. {
  7. "rules": {
  8. "jest/no-restricted-matchers": [
  9. "error",
  10. {
  11. "toThrowErrorMatchingSnapshot": "Use `toThrowErrorMatchingInlineSnapshot()` instead",
  12. "toMatchSnapshot": "Use `toMatchInlineSnapshot()` instead"
  13. }
  14. ]
  15. }
  16. }
  17. ```
  18. ---
  19. In order to make snapshot tests more manageable and reviewable
  20. `toMatchInlineSnapshot()` and `toThrowErrorMatchingInlineSnapshot` should be
  21. used to write the snapshots' inline in the test file.
  22. ## Rule details
  23. This rule triggers a warning if `toMatchSnapshot()` or
  24. `toThrowErrorMatchingSnapshot` is used to capture a snapshot.
  25. The following pattern is considered warning:
  26. ```js
  27. expect(obj).toMatchSnapshot();
  28. ```
  29. ```js
  30. expect(error).toThrowErrorMatchingSnapshot();
  31. ```
  32. The following pattern is not warning:
  33. ```js
  34. expect(obj).toMatchInlineSnapshot();
  35. ```
  36. ```js
  37. expect(error).toThrowErrorMatchingInlineSnapshot();
  38. ```