Socket
Socket
Sign inDemoInstall

jest-runner

Package Overview
Dependencies
21
Maintainers
6
Versions
236
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-runner


Version published
Maintainers
6
Install size
17.8 MB
Created

Package description

What is jest-runner?

The jest-runner npm package is a custom runner for Jest that allows you to run tests with a specified test runner. It is part of the Jest ecosystem and is used to execute tests written for Jest in a customizable environment. It can be used to run tests in parallel, to specify custom test environments, and to integrate with other testing tools and frameworks.

What are jest-runner's main functionalities?

Running tests in parallel

By default, Jest runs all tests in parallel, which can speed up the test execution time. However, if you need to run tests serially (one after another), you can use the `--runInBand` or `-i` option. This is useful when tests are not isolated and may interfere with each other when run in parallel.

jest --runInBand

Custom test environments

Jest allows you to specify a custom test environment for your tests. By setting the `testEnvironment` option in your Jest configuration, you can choose the environment in which your tests will run, such as `node` for a Node.js environment or `jsdom` for a browser-like environment. The `runner` option can be set to `jest-runner` to use it as the test runner.

module.exports = {
  testEnvironment: 'node',
  runner: 'jest-runner'
};

Integrating with other testing tools

Jest-runner can be extended to integrate with other testing tools and frameworks. For example, `jest-runner-eslint` allows you to run ESLint as a Jest test, providing a unified testing and linting workflow. You can configure Jest to use different runners for different types of tests or files, and you can also add watch plugins to enhance the developer experience during watch mode.

module.exports = {
  runner: 'jest-runner-eslint',
  displayName: 'lint',
  testMatch: ['<rootDir>/src/**/*.js'],
  watchPlugins: [
    'jest-watch-typeahead/filename',
    'jest-watch-typeahead/testname',
  ]
};

Other packages similar to jest-runner

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