jest-each-table
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "jest-each-table", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Create a test-case table for use with Jest's test.each tagged template literal", | ||
"author": "Cameron Hunter <hello@cameronhunter.co.uk>", | ||
"repository": { | ||
"type": "git", | ||
"url": "ssh://git@github.com:cameronhunter/jest-each-table.git" | ||
}, | ||
"license": "MIT", | ||
@@ -7,0 +11,0 @@ "main": "./src/index.js", |
@@ -5,3 +5,3 @@ const Separator = '|'; | ||
const keys = testcases.reduce((state, object) => new Set([...state, ...Object.keys(object)]), new Set()); | ||
return [...keys]; | ||
return ['#', ...keys]; | ||
} | ||
@@ -11,3 +11,6 @@ | ||
return testcases.reduce( | ||
(values, testcase) => [...values, ...columns.reduce((state, column) => [...state, testcase[column]], [])], | ||
(values, testcase, index) => [ | ||
...values, | ||
...columns.reduce((state, column) => [...state, column === '#' ? index + 1 : testcase[column]], []) | ||
], | ||
[] | ||
@@ -14,0 +17,0 @@ ); |
@@ -12,3 +12,3 @@ const createTestTable = require('./index'); | ||
testsuite('$inputs.left + $inputs.right = $output', ({ inputs, output }) => { | ||
testsuite('Testcase $#: $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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4010
39
0