Socket
Socket
Sign inDemoInstall

@jest/reporters

Package Overview
Dependencies
153
Maintainers
6
Versions
132
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jest/reporters

Jest's reporters


Version published
Weekly downloads
23M
decreased by-0.16%
Maintainers
6
Created
Weekly downloads
 

Package description

What is @jest/reporters?

The @jest/reporters package provides utilities for handling and customizing the output of test results when using Jest, a popular JavaScript testing framework. It allows developers to create custom reporters to modify how test results are reported, making it easier to integrate with various CI tools, generate reports in different formats, or enhance the testing experience with additional logging and notifications.

What are @jest/reporters's main functionalities?

Custom Test Reporter

This feature allows developers to create a custom test reporter by implementing methods that Jest calls at different stages of the test run. The example shows a basic custom reporter that logs messages at the start and end of the test suite, as well as after each test result.

class MyCustomReporter {
  onRunStart(results, options) {
    console.log('Test suite started');
  }

  onTestResult(test, testResult, aggregatedResult) {
    console.log(`Test ${test.path} finished with ${testResult.numFailingTests} failures`);
  }

  onRunComplete(contexts, results) {
    console.log('All tests completed');
  }
}

module.exports = MyCustomReporter;

Other packages similar to @jest/reporters

Changelog

Source

29.2.0

Features

  • [@jest/cli, jest-config] A seed for the test run will be randomly generated, or set by a CLI option (#13400)
  • [@jest/cli, jest-config] --show-seed will display the seed value in the report, and can be set via a CLI flag or through the config file (#13400)
  • [jest-config] Add readInitialConfig utility function (#13356)
  • [jest-core] Allow testResultsProcessor to be async (#13343)
  • [@jest/environment, jest-environment-node, jest-environment-jsdom, jest-runtime] Add getSeed() to the jest object (#13400)
  • [expect, @jest/expect-utils] Allow isA utility to take a type argument (#13355)
  • [expect] Expose AsyncExpectationResult and SyncExpectationResult types (#13411)

Fixes

  • [babel-plugin-jest-hoist] Ignore TSTypeQuery when checking for hoisted references (#13367)
  • [jest-core] Fix detectOpenHandles false positives for some special objects such as TLSWRAP (#13414)
  • [jest-mock] Fix mocking of getters and setters on classes (#13398)
  • [jest-reporters] Revert: Transform file paths into hyperlinks (#13399)
  • [@jest/types] Infer type of each table correctly when the table is a tuple or array (#13381)
  • [@jest/types] Rework typings to allow the *ReturnedWith matchers to be called with no argument (#13385)

Chore & Maintenance

  • [*] Update @babel/* deps, resulting in slightly different stack traces for each (#13422)

Performance

  • [jest-runner] Do not instrument v8 coverage data if coverage should not be collected (#13282)

FAQs

Last updated on 14 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc