Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
jest-runner
Advanced tools
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.
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',
]
};
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple. It is similar to Jest in that it provides a test running environment, but it has a different API and requires manual configuration of assertion libraries, mocking, and spying tools.
Jasmine is a behavior-driven development framework for testing JavaScript code. It does not require a DOM and has a clean, obvious syntax so that you can easily write tests. It is similar to Jest but is considered less opinionated in terms of how tests are structured and executed.
AVA is a test runner for Node.js with a concise API, detailed error output, and process isolation that lets you develop with confidence. AVA is similar to Jest-runner in that it can run tests in parallel, but it emphasizes minimalism and speed, and it does not provide a built-in mocking library.
Karma is a test runner that works with any framework (such as Mocha, Jasmine, QUnit, and more), which makes it highly adaptable. It is designed to work with continuous integration tools and offers a plugin system. Unlike Jest, Karma is primarily used for running tests in actual browsers, which is useful for testing browser-specific issues.
jest 22.1.0
[jest-cli]
Make Jest exit without an error when no tests are found in the case of --lastCommit
, --findRelatedTests
, or --onlyChanged
options having been passed to the CLI[jest-cli]
Add interactive snapshot mode (#3831)[jest-cli]
Use import-local
to support global Jest installations. (#5304)[jest-runner]
Fix memory leak in coverage reporting (#5289)[docs]
Update mention of the minimal version of node supported (#4947)[jest-cli]
Fix missing newline in console message (#5308)[jest-cli]
--lastCommit
and --changedFilesWithAncestor
now take effect even when --onlyChanged
is not specified. (#5307)[filenames]
Standardize folder names under integration-tests/
(#5298)FAQs
Unknown package
The npm package jest-runner receives a total of 9,994,614 weekly downloads. As such, jest-runner popularity was classified as popular.
We found that jest-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.