cypress-each
Advanced tools
Comparing version 1.9.0 to 1.10.0
{ | ||
"name": "cypress-each", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Simple implementation for describe.each and it.each", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -191,2 +191,11 @@ # cypress-each ![cypress version](https://img.shields.io/badge/cypress-9.0.0-brightgreen) [![renovate-app badge][renovate-badge]][renovate-app] [![ci](https://github.com/bahmutov/cypress-each/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/cypress-each/actions/workflows/ci.yml) | ||
## Sampling | ||
Cypress bundles [Lodash](https://lodash.com/) library which includes `_.sampleSize` method that you can use to randomly pick N items when passing the list to `it.each` | ||
```js | ||
// pick 2 random items from the array and create 2 tests | ||
it.each(Cypress._.sampleSize(items, 2))(...) | ||
``` | ||
## Custom filter predicate | ||
@@ -201,2 +210,11 @@ | ||
## Return value | ||
`it.each(...)(...)` and `describe.each(...)(...)` return the number of created tests. | ||
```js | ||
const n = it.each([1, 2])(...) | ||
// n is 2 | ||
``` | ||
## Exclusive tests | ||
@@ -203,0 +221,0 @@ |
@@ -101,2 +101,5 @@ /// <reference types="cypress" /> | ||
}, this) | ||
// returns the number of created tests | ||
return values.length | ||
} | ||
@@ -144,2 +147,5 @@ } | ||
}) | ||
// returns the number of created suites | ||
return values.length | ||
} | ||
@@ -146,0 +152,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17541
172
334