Socket
Socket
Sign inDemoInstall

@jest/test-result

Package Overview
Dependencies
39
Maintainers
6
Versions
109
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jest/test-result


Version published
Maintainers
6
Created

Package description

What is @jest/test-result?

The @jest/test-result package is part of the Jest testing framework, primarily used to handle and represent the results of tests. It provides structures and utility functions to process and display the outcomes of test suites and individual tests.

What are @jest/test-result's main functionalities?

Create a test result

This feature allows developers to create a structured test result object, which includes the number of passing, failing, and pending tests, along with detailed results for each test.

{
  "numFailingTests": 0,
  "numPassingTests": 3,
  "numPendingTests": 0,
  "testResults": [
    {
      "fullName": "adds 1 + 2 to equal 3",
      "status": "passed"
    }
  ]
}

Summarize test results

This utility function summarizes the test results, providing a quick overview of the test suite's outcome. It's useful for generating reports or logs.

const { summarizeResults } = require('@jest/test-result');
const testResults = {
  numFailingTests: 1,
  numPassingTests: 2,
  numPendingTests: 1,
  testResults: [
    { fullName: 'test1', status: 'passed' },
    { fullName: 'test2', status: 'failed' },
    { fullName: 'test3', status: 'pending' }
  ]
};
console.log(summarizeResults(testResults));

Other packages similar to @jest/test-result

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc