cypress-each
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "cypress-each", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Simple implementation for describe.each and it.each", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -15,5 +15,5 @@ /// <reference types="cypress" /> | ||
if (!it.each) { | ||
it.each = (values) => { | ||
it.each = function (values) { | ||
return function (titlePattern, testCallback) { | ||
values.forEach((value, k) => { | ||
values.forEach(function (value, k) { | ||
const testTitle = titlePattern.replace('%k', k).replace('%K', k + 1) | ||
@@ -24,8 +24,12 @@ | ||
const title = formatTitle(testTitle, ...value) | ||
it(title, testCallback.bind(null, ...value)) | ||
it(title, function itArrayCallback() { | ||
return testCallback.apply(this, value) | ||
}) | ||
} else { | ||
const title = formatTitle(testTitle, value) | ||
it(title, testCallback.bind(null, value)) | ||
it(title, function itCallback() { | ||
return testCallback.call(this, value) | ||
}) | ||
} | ||
}) | ||
}, this) | ||
} | ||
@@ -36,3 +40,3 @@ } | ||
if (!describe.each) { | ||
describe.each = (values) => { | ||
describe.each = function (values) { | ||
return function describeEach(titlePattern, testCallback) { | ||
@@ -39,0 +43,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
9028
67