jest-each-table
Advanced tools
Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "jest-each-table", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Create a test-case table for use with Jest's test.each tagged template literal", | ||
@@ -17,5 +17,5 @@ "author": "Cameron Hunter <hello@cameronhunter.co.uk>", | ||
"devDependencies": { | ||
"jest": "^24.1.0", | ||
"prettier": "^1.16.4" | ||
"jest": "^27.0.6", | ||
"prettier": "^2.3.2" | ||
} | ||
} |
const Separator = '|'; | ||
const IndexHeader = 'testcaseIndex'; | ||
function getColumnTitlesFor(testcases) { | ||
const keys = testcases.reduce((state, object) => new Set([...state, ...Object.keys(object)]), new Set()); | ||
return ['#', ...keys]; | ||
return [IndexHeader, ...keys]; | ||
} | ||
@@ -12,3 +13,3 @@ | ||
...values, | ||
...columns.reduce((state, column) => [...state, column === '#' ? index + 1 : testcase[column]], []) | ||
...columns.reduce((state, column) => [...state, column === IndexHeader ? index + 1 : testcase[column]], []), | ||
], | ||
@@ -15,0 +16,0 @@ [] |
@@ -12,3 +12,3 @@ const createTestTable = require('./index'); | ||
testsuite('Testcase $#: $inputs.left + $inputs.right = $output', ({ inputs, output }) => { | ||
testsuite('Testcase $testcaseIndex: $inputs.left + $inputs.right = $output', ({ inputs, output }) => { | ||
expect(inputs.left + inputs.right).toBe(output); | ||
@@ -15,0 +15,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
4087
40