Socket
Socket
Sign inDemoInstall

jest-each

Package Overview
Dependencies
3
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 23.6.0 to 24.0.0-alpha.0

LICENSE

95

build/bind.js

@@ -7,2 +7,50 @@ 'use strict';

var _slicedToArray = (function() {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (
var _i = arr[Symbol.iterator](), _s;
!(_n = (_s = _i.next()).done);
_n = true
) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i['return']) _i['return']();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function(arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError(
'Invalid attempt to destructure non-iterable instance'
);
}
};
})();
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _util;

@@ -26,2 +74,8 @@

var _jestUtil;
function _load_jestUtil() {
return (_jestUtil = require('jest-util'));
}
function _interopRequireDefault(obj) {

@@ -44,10 +98,2 @@ return obj && obj.__esModule ? obj : {default: obj};

}
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/

@@ -74,5 +120,23 @@ const EXPECTED_COLOR = (_chalk || _load_chalk()).default.green;

if (args.length === 1) {
const table = args[0].every(Array.isArray)
? args[0]
: args[0].map(entry => [entry]);
var _args = _slicedToArray(args, 1);
const tableArg = _args[0];
if (!Array.isArray(tableArg)) {
const error = new (_jestUtil || _load_jestUtil()).ErrorWithStack(
'`.each` must be called with an Array or Tagged Template String.\n\n' +
`Instead was called with: ${(0,
(_prettyFormat || _load_prettyFormat()).default)(tableArg, {
maxDepth: 1,
min: true
})}\n`,
eachBind
);
return cb(title, () => {
throw error;
});
}
const table = tableArg.every(Array.isArray)
? tableArg
: tableArg.map(entry => [entry]);
return table.forEach((row, i) =>

@@ -99,3 +163,3 @@ cb(

if (missingData > 0) {
const error = new Error(
const error = new (_jestUtil || _load_jestUtil()).ErrorWithStack(
'Not enough arguments supplied for given headings:\n' +

@@ -112,9 +176,6 @@ EXPECTED_COLOR(keys.join(' | ')) +

missingData
)}`
)}`,
eachBind
);
if (Error.captureStackTrace) {
Error.captureStackTrace(error, eachBind);
}
return cb(title, () => {

@@ -121,0 +182,0 @@ throw error;

8

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

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

"chalk": "^2.0.1",
"pretty-format": "^23.6.0"
}
"jest-util": "^24.0.0-alpha.0",
"pretty-format": "^24.0.0-alpha.0"
},
"gitHead": "22f67d49ffcce7a5b6d6891438b837b3b26ba9db"
}
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc