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-export.md 992B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Disallow using `exports` in files containing tests (`no-export`)
  2. Prevents using `exports` if a file has one or more tests in it.
  3. ## Rule Details
  4. This rule aims to eliminate duplicate runs of tests by exporting things from
  5. test files. If you import from a test file, then all the tests in that file will
  6. be run in each imported instance, so bottom line, don't export from a test, but
  7. instead move helper functions into a separate file when they need to be shared
  8. across tests.
  9. Examples of **incorrect** code for this rule:
  10. ```js
  11. export function myHelper() {}
  12. module.exports = function () {};
  13. module.exports = {
  14. something: 'that should be moved to a non-test file',
  15. };
  16. describe('a test', () => {
  17. expect(1).toBe(1);
  18. });
  19. ```
  20. Examples of **correct** code for this rule:
  21. ```js
  22. function myHelper() {}
  23. const myThing = {
  24. something: 'that can live here',
  25. };
  26. describe('a test', () => {
  27. expect(1).toBe(1);
  28. });
  29. ```
  30. ## When Not To Use It
  31. Don't use this rule on non-jest test files.