Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fast-check/jest

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fast-check/jest - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

15

lib/esm/jest-fast-check.js

@@ -7,8 +7,15 @@ import { it, test } from '@jest/globals';

function internalTestPropExecute(testFn, label, arbitraries, prop, params) {
const customParams = params || {};
if (customParams.seed === undefined)
customParams.seed = Date.now();
const customParams = Object.assign({}, params);
if (customParams.seed === undefined) {
const seedFromGlobals = fc.readConfigureGlobal().seed;
if (seedFromGlobals !== undefined) {
customParams.seed = seedFromGlobals;
}
else {
customParams.seed = Date.now();
}
}
const promiseProp = wrapProp(prop);
testFn(`${label} (with seed=${customParams.seed})`, async () => {
await fc.assert(fc.asyncProperty(...arbitraries, promiseProp), params);
await fc.assert(fc.asyncProperty(...arbitraries, promiseProp), customParams);
});

@@ -15,0 +22,0 @@ }

@@ -6,39 +6,39 @@ import * as fc from 'fast-check';

declare type Prop<Ts extends [any] | any[]> = (...args: Ts) => boolean | void | PromiseLike<boolean | void>;
export declare const testProp: (<Ts extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<Ts> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
export declare const testProp: (<Ts extends any[] | [any], TsParameters extends Ts = Ts>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<TsParameters> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
skip: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
skip: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
} & {
concurrent: (<Ts extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<Ts> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
concurrent: (<Ts extends any[] | [any], TsParameters extends Ts = Ts>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<TsParameters> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
skip: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
skip: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
todo: (testName: string | (number | Function)) => void;
};
export declare const itProp: (<Ts extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<Ts> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
export declare const itProp: (<Ts extends any[] | [any], TsParameters extends Ts = Ts>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<TsParameters> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
skip: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
skip: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
} & {
concurrent: (<Ts extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<Ts> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
concurrent: (<Ts extends any[] | [any], TsParameters extends Ts = Ts>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<TsParameters> | undefined) => void) & {
only: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
skip: (<Ts_1 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<Ts_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
skip: (<Ts_1 extends any[] | [any], TsParameters_1 extends Ts_1 = Ts_1>(label: string, arbitraries: ArbitraryTuple<Ts_1>, prop: Prop<Ts_1>, params?: fc.Parameters<TsParameters_1> | undefined) => void) & {
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};
failing: <Ts_2 extends any[] | [any]>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<Ts_2> | undefined) => void;
failing: <Ts_2 extends any[] | [any], TsParameters_2 extends Ts_2 = Ts_2>(label: string, arbitraries: ArbitraryTuple<Ts_2>, prop: Prop<Ts_2>, params?: fc.Parameters<TsParameters_2> | undefined) => void;
};

@@ -45,0 +45,0 @@ todo: (testName: string | (number | Function)) => void;

@@ -11,8 +11,15 @@ "use strict";

function internalTestPropExecute(testFn, label, arbitraries, prop, params) {
const customParams = params || {};
if (customParams.seed === undefined)
customParams.seed = Date.now();
const customParams = Object.assign({}, params);
if (customParams.seed === undefined) {
const seedFromGlobals = fc.readConfigureGlobal().seed;
if (seedFromGlobals !== undefined) {
customParams.seed = seedFromGlobals;
}
else {
customParams.seed = Date.now();
}
}
const promiseProp = wrapProp(prop);
testFn(`${label} (with seed=${customParams.seed})`, async () => {
await fc.assert(fc.asyncProperty(...arbitraries, promiseProp), params);
await fc.assert(fc.asyncProperty(...arbitraries, promiseProp), customParams);
});

@@ -19,0 +26,0 @@ }

{
"name": "@fast-check/jest",
"description": "Property based testing for Jest based on fast-check",
"version": "1.1.0",
"version": "1.1.1",
"type": "commonjs",

@@ -6,0 +6,0 @@ "main": "lib/jest-fast-check.js",

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