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-to-have-length.md 674B

123456789101112131415161718192021222324252627282930313233
  1. # Suggest using `toHaveLength()` (`prefer-to-have-length`)
  2. In order to have a better failure message, `toHaveLength()` should be used upon
  3. asserting expectations on objects length property.
  4. ## Rule details
  5. This rule triggers a warning if `toBe()`, `toEqual()` or `toStrictEqual()` is
  6. used to assert objects length property.
  7. ```js
  8. expect(files.length).toBe(1);
  9. ```
  10. This rule is enabled by default.
  11. ### Default configuration
  12. The following patterns are considered warnings:
  13. ```js
  14. expect(files.length).toBe(1);
  15. expect(files.length).toEqual(1);
  16. expect(files.length).toStrictEqual(1);
  17. ```
  18. The following pattern is not warning:
  19. ```js
  20. expect(files).toHaveLength(1);
  21. ```