2.9.0 • Published 6 years ago

jest-plugin-for-each v2.9.0

Weekly downloads
197
License
MIT
Repository
github
Last release
6 years ago

jest-plugin-for-each

npm npm npm

Jest plugin to test multiple values for a single outcome.

Getting Started

Install jest-plugin-for-each using yarn:

yarn add --dev jest-plugin-for-each

Motivation

Building off of jest-plugin-set, we can use jest-plugin-for-each to define a set of tests that all expect the same outcome given a different set of fixed values. Here's an example:

// TODO

Usage

If you want, you can import forEach from jest-plugin-for-each at the top of every test:

import forEach from 'jest-plugin-for-each';

If you want to install forEach as a global, you can modify the jest section of your package.json to include:

"jest": {
  "setupFiles": [
    "jest-plugin-for-each/setup"
  ]
}

Example

Here's an example test that tests forEach itself:

// TODO
2.9.0

6 years ago

2.8.2

6 years ago

2.8.1

6 years ago

2.8.0

6 years ago

2.7.0

6 years ago

2.6.0

6 years ago

2.5.1

6 years ago

2.5.0

7 years ago

2.4.2

7 years ago

2.4.1

7 years ago

2.4.0

7 years ago

2.3.4

7 years ago

2.3.3

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.8.3

7 years ago

1.8.0

7 years ago

1.7.1

7 years ago

1.7.0

7 years ago

1.5.0

7 years ago