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.

README.md 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. [type-definitions]: https://github.com/facebook/jest/blob/main/packages/jest-types/src/Circus.ts
  2. <h1 align="center">
  3. <img src="https://jestjs.io/img/jest.png" height="150" width="150"/>
  4. <img src="https://jestjs.io/img/circus.png" height="150" width="150"/>
  5. <p align="center">jest-circus</p>
  6. <p align="center">The next-gen test runner for Jest</p>
  7. </h1>
  8. ## Overview
  9. Circus is a flux-based test runner for Jest that is fast, maintainable, and simple to extend.
  10. Circus allows you to bind to events via an optional event handler on any [custom environment](https://jestjs.io/docs/configuration#testenvironment-string). See the [type definitions][type-definitions] for more information on the events and state data currently available.
  11. ```js
  12. import {Event, State} from 'jest-circus';
  13. import NodeEnvironment from 'jest-environment-node';
  14. class MyCustomEnvironment extends NodeEnvironment {
  15. //...
  16. async handleTestEvent(event: Event, state: State) {
  17. if (event.name === 'test_start') {
  18. // ...
  19. }
  20. }
  21. }
  22. ```
  23. Mutating event or state data is currently unsupported and may cause unexpected behavior or break in a future release without warning. New events, event data, and/or state data will not be considered a breaking change and may be added in any minor release.
  24. Note, that `jest-circus` test runner would pause until a promise returned from `handleTestEvent` gets fulfilled. **However, there are a few events that do not conform to this rule, namely**: `start_describe_definition`, `finish_describe_definition`, `add_hook`, `add_test` or `error` (for the up-to-date list you can look at [SyncEvent type in the types definitions][type-definitions]). That is caused by backward compatibility reasons and `process.on('unhandledRejection', callback)` signature, but that usually should not be a problem for most of the use cases.
  25. ## Installation
  26. > Note: As of Jest 27, `jest-circus` is the default test runner, so you do not have to install it to use it.
  27. Install `jest-circus` using yarn:
  28. ```bash
  29. yarn add --dev jest-circus
  30. ```
  31. Or via npm:
  32. ```bash
  33. npm install --save-dev jest-circus
  34. ```
  35. ## Configure
  36. Configure Jest to use `jest-circus` via the [`testRunner`](https://jestjs.io/docs/configuration#testrunner-string) option:
  37. ```json
  38. {
  39. "testRunner": "jest-circus/runner"
  40. }
  41. ```
  42. Or via CLI:
  43. ```bash
  44. jest --testRunner='jest-circus/runner'
  45. ```