Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-each

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-each - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc