Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

jest-circus

Package Overview
Dependencies
19
Maintainers
6
Versions
218
Issues
File Explorer

Advanced tools

jest-circus

[type-definitions]: https://github.com/facebook/jest/blob/main/packages/jest-types/src/Circus.ts

    28.1.3latest

Version published
Maintainers
6
Weekly downloads
11,223,783
decreased by-2.11%

Weekly downloads

Changelog

Source

28.1.3

Features

  • [jest-leak-detector] Use native FinalizationRegistry when it exists to get rid of external C dependency (#12973)

Fixes

  • [jest-changed-files] Fix a lock-up after repeated invocations (#12757)
  • [@jest/expect-utils] Fix deep equality of ImmutableJS OrderedSets (#12977)
  • [jest-mock] Add index signature support for spyOn types (#13013, #13020)
  • [jest-snapshot] Fix indentation of awaited inline snapshots (#12986)

Chore & Maintenance

  • [*] Replace internal usage of pretty-format/ConvertAnsi with jest-serializer-ansi-escapes (#12935, #13004)
  • [docs] Update spyOn docs (#13000)

Readme

Source

jest-circus

The next-gen test runner for Jest

Overview

Circus is a flux-based test runner for Jest that is fast, maintainable, and simple to extend.

Circus allows you to bind to events via an optional event handler on any custom environment. See the type definitions for more information on the events and state data currently available.

import {Event, State} from 'jest-circus'; import NodeEnvironment from 'jest-environment-node'; class MyCustomEnvironment extends NodeEnvironment { //... async handleTestEvent(event: Event, state: State) { if (event.name === 'test_start') { // ... } } }

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.

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). 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.

Installation

Note: As of Jest 27, jest-circus is the default test runner, so you do not have to install it to use it.

Install jest-circus using yarn:

yarn add --dev jest-circus

Or via npm:

npm install --save-dev jest-circus

Configure

Configure Jest to use jest-circus via the testRunner option:

{ "testRunner": "jest-circus/runner" }

Or via CLI:

jest --testRunner='jest-circus/runner'

FAQs

What is jest-circus?

[type-definitions]: https://github.com/facebook/jest/blob/main/packages/jest-types/src/Circus.ts

Is jest-circus popular?

The npm package jest-circus receives a total of 9,456,603 weekly downloads. As such, jest-circus popularity was classified as popular.

Is jest-circus well maintained?

We found that jest-circus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 6 open source maintainers collaborating on the project.

Last updated on 13 Jul 2022
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc