web 3d图形渲染器
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.

33 lines
612 B

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