New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2.0

18

CHANGELOG.md

@@ -0,1 +1,19 @@

# 1.2.0
_Align seed computation with fast-check's one_
[[Code](https://github.com/dubzzz/fast-check/tree/jest%2Fv1.2.0)][[Diff](https://github.com/dubzzz/fast-check/compare/jest%2Fv1.1.0...jest%2Fv1.2.0)]
## Features
- ([PR#3277](https://github.com/dubzzz/fast-check/pull/3277)) Align seed computation with fast-check's one
## Fixes
- ([PR#3279](https://github.com/dubzzz/fast-check/pull/3279)) Bug: Pass the forged seed to the runner
- ([PR#3281](https://github.com/dubzzz/fast-check/pull/3281)) Bug: Fallback on the seed coming from globals if any
- ([PR#3282](https://github.com/dubzzz/fast-check/pull/3282)) Test: Rewrite tests of `@fast-check/jest`
- ([PR#3284](https://github.com/dubzzz/fast-check/pull/3284)) Test: Faster tests without `babel-jest`
---
# 1.1.0

@@ -2,0 +20,0 @@

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() ^ (Math.random() * 0x100000000);
}
}
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 @@ }

@@ -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() ^ (Math.random() * 0x100000000);
}
}
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.2.0",
"type": "commonjs",

@@ -26,4 +26,3 @@ "main": "lib/jest-fast-check.js",

"build:publish-esm": "tsc -p tsconfig.publish.json --module es2015 --moduleResolution node --outDir lib/esm && cp package.esm-template.json lib/esm/package.json",
"jest-test": "jest",
"test": "sh test.sh",
"test": "jest",
"typecheck": "tsc --noEmit"

@@ -49,8 +48,8 @@ },

"devDependencies": {
"@jest/globals": "^29.0.3",
"@jest/globals": "^29.1.2",
"@types/node": "^17.0.44",
"fast-check": "3.1.4",
"jest": "^29.0.3",
"ts-jest": "^29.0.1",
"typescript": "^4.8.3"
"fast-check": "3.2.0",
"jest": "^29.1.2",
"ts-jest": "^29.0.3",
"typescript": "^4.8.4"
},

@@ -57,0 +56,0 @@ "keywords": [

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