🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

jest-theories

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-theories - npm Package Compare versions

Comparing version

to
1.3.0

5

dist/index.js

@@ -29,9 +29,10 @@ 'use strict';

theories.forEach(function (theory, idx) {
for (var idx = 0; idx < theories.length; idx++) {
var theory = theories[idx];
var testName = isFunctionTestNameCreator ? testNameCreator(theory, idx) : (0, _stringFormat2.default)(testNameCreator, Object.assign({}, theory, { "$idx": idx, "$no": idx + 1 }));
test(testName, testFunc.bind(undefined, theory));
});
}
};
exports.default = theoretically;

2

index.d.ts

@@ -7,3 +7,3 @@ /**

*/
declare function theoretically<T>(description: string | ((theory: T, index: number) => string), theories: T[], testFunction: (theory: T) => void): void;
declare function theoretically<T>(description: string | ((theory: T, index: number) => string), theories: T[], testFunction: (theory: T) => Promise<void> | void): void;
export default theoretically;

@@ -13,7 +13,8 @@ import format from 'string-format';

if(!isFunctionTestNameCreator && typeof testNameCreator !== 'string') {
if (!isFunctionTestNameCreator && typeof testNameCreator !== 'string') {
throw new Error('Test name creator must be a string or a function')
}
theories.forEach((theory, idx) => {
for (let idx = 0; idx < theories.length; idx++) {
const theory = theories[idx]
const testName = isFunctionTestNameCreator

@@ -27,5 +28,5 @@ ? testNameCreator(theory, idx)

);
});
}
};
export default theoretically;
{
"name": "jest-theories",
"version": "1.2.0",
"version": "1.3.0",
"scripts": {

@@ -5,0 +5,0 @@ "build": "babel index.js --out-dir dist"