Socket
Socket
Sign inDemoInstall

jest-each

Package Overview
Dependencies
Maintainers
2
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-each - npm Package Compare versions

Comparing version 24.0.0-alpha.4 to 24.0.0-alpha.5

36

build/bind.js

@@ -123,3 +123,3 @@ 'use strict';

const error = new (_jestUtil || _load_jestUtil()).ErrorWithStack(
'`.each` must be called with an Array or Tagged Template String.\n\n' +
'`.each` must be called with an Array or Tagged Template Literal.\n\n' +
`Instead was called with: ${(0,

@@ -136,2 +136,32 @@ (_prettyFormat || _load_prettyFormat()).default)(tableArg, {

}
if (isTaggedTemplateLiteral(tableArg)) {
if (isEmptyString(tableArg[0])) {
const error = new (_jestUtil || _load_jestUtil()).ErrorWithStack(
'Error: `.each` called with an empty Tagged Template Literal of table data.\n',
eachBind
);
return cb(title, () => {
throw error;
});
}
const error = new (_jestUtil || _load_jestUtil()).ErrorWithStack(
'Error: `.each` called with a Tagged Template Literal with no data, remember to interpolate with ${expression} syntax.\n',
eachBind
);
return cb(title, () => {
throw error;
});
}
if (isEmptyTable(tableArg)) {
const error = new (_jestUtil || _load_jestUtil()).ErrorWithStack(
'Error: `.each` called with an empty Array of table data.\n',
eachBind
);
return cb(title, () => {
throw error;
});
}
const table = tableArg.every(Array.isArray)

@@ -193,2 +223,6 @@ ? tableArg

const isTaggedTemplateLiteral = array => array.raw !== undefined;
const isEmptyTable = table => table.length === 0;
const isEmptyString = str => typeof str === 'string' && str.trim() === '';
const getPrettyIndexes = placeholders =>

@@ -195,0 +229,0 @@ placeholders.reduce(

8

package.json
{
"name": "jest-each",
"version": "24.0.0-alpha.4",
"version": "24.0.0-alpha.5",
"description": "Parameterised tests for Jest",

@@ -20,4 +20,4 @@ "main": "build/index.js",

"chalk": "^2.0.1",
"jest-util": "^24.0.0-alpha.4",
"pretty-format": "^24.0.0-alpha.4"
"jest-util": "^24.0.0-alpha.5",
"pretty-format": "^24.0.0-alpha.5"
},

@@ -27,3 +27,3 @@ "engines": {

},
"gitHead": "e41f0bb257c6652c3100b97a1087f9f812fbea0d"
"gitHead": "2c18a53e8ff2437bba5fcb8076b754ac5f79f9f8"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc