cypress-each
Advanced tools
Comparing version 1.13.1 to 1.13.2
{ | ||
"name": "cypress-each", | ||
"version": "1.13.1", | ||
"version": "1.13.2", | ||
"description": "Simple implementation for describe.each and it.each", | ||
@@ -11,3 +11,3 @@ "main": "src", | ||
"scripts": { | ||
"lint": "tsc --pretty --allowJs --strict --noEmit src/index.js cypress/**/*.js cypress/**/*.ts", | ||
"lint": "tsc --pretty --allowJs --strict --noEmit src/index.js cypress/**/*.ts", | ||
"test": "cypress-expect run --expect cypress/expected.json", | ||
@@ -20,7 +20,7 @@ "semantic-release": "semantic-release" | ||
"devDependencies": { | ||
"cypress": "11.0.1", | ||
"cypress": "12.11.0", | ||
"cypress-expect": "2.5.3", | ||
"mocha-each": "^2.0.1", | ||
"prettier": "^2.4.1", | ||
"semantic-release": "19.0.5", | ||
"semantic-release": "21.0.2", | ||
"typescript": "^4.8.4" | ||
@@ -27,0 +27,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
# cypress-each ![cypress version](https://img.shields.io/badge/cypress-11.0.1-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) | ||
# cypress-each ![cypress version](https://img.shields.io/badge/cypress-12.11.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) | ||
@@ -3,0 +3,0 @@ > A demo of mocha-each and custom describe.each and it.each implementation for Cypress |
@@ -21,3 +21,9 @@ // types for it.each and describe.each | ||
declare namespace Mocha { | ||
type TestCallback<T> = (this: Context, arg0: T, arg1: any, arg2: any) => void | ||
type TestCallback<T extends readonly any[]> = T extends [] | ||
? (this: Context, arg1: any, arg2: any) => void | ||
: Parameters<(...res: [...T, any, any]) => void> extends [...infer R] | ||
? R extends readonly [...T, any, any] | ||
? (this: Context, ...res: [...R]) => void | ||
: never | ||
: never | ||
type TestCallback1<T0> = (this: Context, arg0: T0) => void | ||
@@ -42,2 +48,10 @@ type TestCallback2<T0, T1> = (this: Context, arg0: T0, arg1: T1) => void | ||
*/ | ||
each<T extends readonly [...T]>( | ||
values: Array<readonly [...T]>, | ||
totalChunks?: number, | ||
chunkIndex?: number, | ||
): ( | ||
titlePattern: string | TestTitleFn<[...T]>, | ||
fn: TestCallback<[...T]>, | ||
) => void | ||
each<T = unknown>( | ||
@@ -47,3 +61,3 @@ values: T[] | number, | ||
chunkIndex?: number, | ||
): (titlePattern: string | TestTitleFn<T>, fn: TestCallback<T>) => void | ||
): (titlePattern: string | TestTitleFn<T>, fn: TestCallback<[T]>) => void | ||
@@ -110,6 +124,6 @@ /** | ||
values: T[] | number, | ||
totalChunks?: number, | ||
totalChunks?: number | ItemPredicateFunction<T>, | ||
chunkIndex?: number, | ||
): (titlePattern: string | TestTitleFn<T>, fn: TestCallback<T>) => void | ||
): (titlePattern: string | TestTitleFn<T>, fn: TestCallback<[T]>) => void | ||
} | ||
} |
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
24163
281