You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

jest-runner

Package Overview
Dependencies
Maintainers
6
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-runner


Version published
Weekly downloads
19M
decreased by-19.27%
Maintainers
6
Created
Weekly downloads
 

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

FAQs

Package last updated on 20 Feb 2024

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc