cypress-each
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "cypress-each", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Simple implementation for describe.each and it.each", | ||
@@ -5,0 +5,0 @@ "main": "src", |
# cypress-each ![cypress version](https://img.shields.io/badge/cypress-8.6.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) | ||
> A demo of mocha-each and custom describe.each and it.each implementation for Cypress | ||
Read [Dynamic API Tests Using Cypress-Each Plugin](https://glebbahmutov.com/blog/dynamic-api-tests-using-cypress-each/) | ||
## Blog posts | ||
Find the implementation in [src/index.js](./src/index.js) | ||
- [Dynamic API Tests Using Cypress-Each Plugin](https://glebbahmutov.com/blog/dynamic-api-tests-using-cypress-each/) | ||
- [Refactor Tests To Be Independent And Fast Using Cypress-Each Plugin](https://glebbahmutov.com/blog/refactor-using-each/) | ||
@@ -127,2 +128,4 @@ ## Install and use | ||
Find the implementation in [src/index.js](./src/index.js) | ||
- [it-spec.js](./cypress/integration/it-spec.js) uses no shortcuts to define multiple tests that are almost the same. We want to avoid the repetition | ||
@@ -129,0 +132,0 @@ - [it-each-spec.js](./cypress/integration/it-each-spec.js) uses the `it.each` helper to generate multiple `it` tests given a data array |
@@ -31,2 +31,6 @@ /// <reference types="cypress" /> | ||
it.each = function (values) { | ||
if (!Array.isArray(values)) { | ||
throw new Error('cypress-each: values must be an array') | ||
} | ||
return function (titlePattern, testCallback) { | ||
@@ -61,2 +65,6 @@ values.forEach(function (value, k) { | ||
describe.each = function (values) { | ||
if (!Array.isArray(values)) { | ||
throw new Error('cypress-each: values must be an array') | ||
} | ||
return function describeEach(titlePattern, testCallback) { | ||
@@ -63,0 +71,0 @@ // define a test for each value |
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
11181
99
211