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.

valid-expect-in-promise.md 657B

12345678910111213141516171819202122232425262728293031
  1. # Enforce having return statement when testing with promises (`valid-expect-in-promise`)
  2. Ensure to return promise when having assertions in `then` or `catch` block of
  3. promise
  4. ## Rule details
  5. This rule looks for tests that have assertions in `then` and `catch` methods on
  6. promises that are not returned by the test.
  7. ### Default configuration
  8. The following pattern is considered warning:
  9. ```js
  10. it('promise test', () => {
  11. somePromise.then(data => {
  12. expect(data).toEqual('foo');
  13. });
  14. });
  15. ```
  16. The following pattern is not warning:
  17. ```js
  18. it('promise test', () => {
  19. return somePromise.then(data => {
  20. expect(data).toEqual('foo');
  21. });
  22. });
  23. ```