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-jasmine-globals.md 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Disallow Jasmine globals (`no-jasmine-globals`)
  2. `jest` uses `jasmine` as a test runner. A side effect of this is that both a
  3. `jasmine` object, and some jasmine-specific globals, are exposed to the test
  4. environment. Most functionality offered by Jasmine has been ported to Jest, and
  5. the Jasmine globals will stop working in the future. Developers should therefore
  6. migrate to Jest's documented API instead of relying on the undocumented Jasmine
  7. API.
  8. ### Rule details
  9. This rule reports on any usage of Jasmine globals which is not ported to Jest,
  10. and suggests alternative from Jest's own API.
  11. ### Default configuration
  12. The following patterns are considered warnings:
  13. ```js
  14. jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
  15. test('my test', () => {
  16. pending();
  17. });
  18. test('my test', () => {
  19. fail();
  20. });
  21. test('my test', () => {
  22. spyOn(some, 'object');
  23. });
  24. test('my test', () => {
  25. jasmine.createSpy();
  26. });
  27. test('my test', () => {
  28. expect('foo').toEqual(jasmine.anything());
  29. });
  30. ```
  31. The following patterns would not be considered warnings:
  32. ```js
  33. jest.setTimeout(5000);
  34. test('my test', () => {
  35. jest.spyOn(some, 'object');
  36. });
  37. test('my test', () => {
  38. jest.fn();
  39. });
  40. test('my test', () => {
  41. expect('foo').toEqual(expect.anything());
  42. });
  43. ```