jest-test-each
Advanced tools
Comparing version 0.8.9 to 0.8.10
@@ -54,4 +54,5 @@ /// <reference types="jest" /> | ||
private runEnsures; | ||
private addName; | ||
run(body: (each: Combined, before: BeforeT) => void): void; | ||
} | ||
export {}; |
@@ -220,2 +220,5 @@ "use strict"; | ||
} | ||
addName(name) { | ||
return this.testParentDesc ? `${this.testParentDesc} ${name}` : name; | ||
} | ||
run(body) { | ||
@@ -240,3 +243,3 @@ const { groupBySuites, testSuiteName, groupParentBySuite } = this.conf; | ||
const flatDesc = { | ||
flatDesc: groupParentBySuite ? desc : desc ? `${this.testParentDesc} ${desc}` : undefined, | ||
flatDesc: groupParentBySuite ? desc : desc ? this.addName(desc) : undefined, | ||
}; | ||
@@ -248,4 +251,4 @@ const fullData = [...fullDatNoFlatDesc, flatDesc.flatDesc ? flatDesc : []]; | ||
if (!groupBySuites && !groupParentBySuite) { | ||
newName.name = `${this.testParentDesc} ${newName.name}`; | ||
nameCaseFull.name = `${this.testParentDesc} ${nameCaseFull.name}`; | ||
newName.name = this.addName(newName.name); | ||
nameCaseFull.name = this.addName(nameCaseFull.name); | ||
} | ||
@@ -256,4 +259,4 @@ const testCase = Object.assign(Object.assign({}, currentTest), { data: utils_1.merge(fullData), name: newName, partialData: utils_1.merge(partialData) }); | ||
}); | ||
root.children.forEach(n => (n.name = groupParentBySuite ? n.name : `${this.testParentDesc} ${n.name}`)); | ||
root.tests.forEach(n => (n.name.name = groupParentBySuite ? n.name.name : `${this.testParentDesc} ${n.name.name}`)); | ||
root.children.forEach(n => (n.name = groupParentBySuite ? n.name : this.addName(n.name))); | ||
root.tests.forEach(n => (n.name.name = groupParentBySuite ? n.name.name : this.addName(n.name.name))); | ||
const isFlat = allCases.every(p => p.isFlat); | ||
@@ -260,0 +263,0 @@ if (this.onlyOne) { |
{ | ||
"name": "jest-test-each", | ||
"version": "0.8.9", | ||
"version": "0.8.10", | ||
"description": "run parametrised tests easily [typesafe] without text tables or arrays of arrays.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
201099
1628