Socket
Socket
Sign inDemoInstall

@jest/reporters

Package Overview
Dependencies
157
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.1.0

Features

  • [expect, @jest/expect] Support type inference for function parameters in CalledWith assertions (#13268)
  • [expect, @jest/expect] Infer type of *ReturnedWith matchers argument (#13278)
  • [@jest/environment, jest-runtime] Allow jest.requireActual and jest.requireMock to take a type argument (#13253)
  • [@jest/environment] Allow jest.mock and jest.doMock to take a type argument (#13254)
  • [@jest/fake-timers] Add jest.now() to return the current fake clock time (#13244, #13246)
  • [@jest/mock] Add withImplementation method for temporarily overriding a mock (#13281)
  • [expect] Export toThrow* matchers (#13328)

Fixes

  • [jest-circus, jest-jasmine2] Fix error messages for Node's assert.throes (#13322)
  • [jest-haste-map] Remove __proto__ usage (#13256)
  • [jest-mock] Improve spyOn typings to handle optional properties (#13247)
  • [jest-mock] Fix mocking of getters and setters on classes (#13145)
  • [jest-snapshot] Throw useful error when an array is passed as property matchers (#13263)
  • [jest-snapshot] Prioritize parser used in the project (#13323)
  • [jest-transform] Attempt to work around issues with atomic writes on Windows (#11423)

FAQs

Last updated on 28 Sep 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