Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Jun 13, 2024 via pnpm

jest-each 29.7.0

Parameterised tests for Jest
Package summary
Share
0
issues
2
licenses
24
MIT
1
ISC
Package created
21 Mar 2017
Version published
12 Sep 2023
Maintainers
6
Total deps
25
Direct deps
5
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
24 Packages, Including:
@jest/schemas@29.6.3
@jest/types@29.6.3
@sinclair/typebox@0.27.8
@types/istanbul-lib-coverage@2.0.6
@types/istanbul-lib-report@3.0.3
@types/istanbul-reports@3.0.4
@types/node@20.14.2
@types/yargs-parser@21.0.3
@types/yargs@17.0.32
ansi-styles@4.3.0
ansi-styles@5.2.0
chalk@4.1.2
ci-info@3.9.0
color-convert@2.0.1
color-name@1.1.4
has-flag@4.0.0
jest-each@29.7.0
jest-get-type@29.6.3
jest-util@29.7.0
picomatch@2.3.1
pretty-format@29.7.0
react-is@18.3.1
supports-color@7.2.0
undici-types@5.26.5

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
graceful-fs@4.2.11
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

5
All Dependencies CSV
β“˜ This is a list of jest-each 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@jest/types29.6.38 kBMIT
prod
chalk4.1.211.31 kBMIT
prod
jest-get-type29.6.31.72 kBMIT
prod
jest-util29.7.010.86 kBMIT
prod
pretty-format29.7.014.34 kBMIT
prod

Visualizations

Frequently Asked Questions

What does jest-each do?

Jest-each is a parameterised testing tool for JavaScript testing framework Jest. Its main function is to allow multiple arguments to be passed into your test or describe functions, resulting in each test or suite being run once per row of parameters. This enables efficient and comprehensive testing across multiple sets of data. The Jest-each library is inspired by the mocha-each library, however it is specifically designed for use with Jest.

How do you use jest-each?

To use jest-each in your JavaScript testing suite, you'll first need to install it. This can be done via npm (Node Package Manager) with the command npm i --save-dev jest-each, or via yarn with yarn add -D jest-each. Once installed, you can import it into your test files. In ES6 syntax, you can import it with import each from 'jest-each';, or if you're using ES5, const each = require('jest-each').default;.

Jest-each can be used in a variety of contexts within your Jest tests. For example, to use it within a test, you can pass an array of arrays containing parameters into the each function, followed by the test function itself. Here's a simple use case:

each([
  [1, 1, 2],
  [1, 2, 3],
  [2, 1, 3],
]).test('returns the result of adding %d to %d', (a, b, expected) => {
  expect(a + b).toBe(expected);
});

In the above example, %d are placeholders for each parameter in the array, and each array of parameters is run as a separate test.

Jest-each can also be used in much the same way for asynchronous tests or describe blocks.

Where are the jest-each docs?

The jest-each docs can be found on the Jest GitHub page at https://github.com/jestjs/jest. Further details about its usage and capabilities can be found there. To stay fully abreast of updates and changes to jest-each, it's recommended to keep an eye on this repository.