@fast-check/jest
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -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 @@ |
@@ -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": [ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16946
167
0