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

fast-check

Package Overview
Dependencies
Maintainers
1
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-check - npm Package Compare versions

Comparing version 3.7.1 to 3.8.0

lib/arbitrary/_internals/builders/GeneratorValueBuilder.js

15

CHANGELOG.md

@@ -0,1 +1,16 @@

# 3.8.0
_Introduce new `gen` arbitrary_
[[Code](https://github.com/dubzzz/fast-check/tree/v3.8.0)][[Diff](https://github.com/dubzzz/fast-check/compare/v3.7.1...v3.8.0)]
## Features
- ([PR#3395](https://github.com/dubzzz/fast-check/pull/3395)) Introduce new `gen` arbitrary
## Fixes
- ([PR#3706](https://github.com/dubzzz/fast-check/pull/3706)) Doc: Document newly added `fc.gen()`
---
# 3.7.1

@@ -2,0 +17,0 @@

7

lib/esm/fast-check-default.js

@@ -6,2 +6,3 @@ import { pre } from './check/precondition/Pre.js';

import { sample, statistics } from './check/runner/Sampler.js';
import { gen } from './arbitrary/gen.js';
import { array } from './arbitrary/array.js';

@@ -105,4 +106,4 @@ import { bigInt } from './arbitrary/bigInt.js';

const __type = 'module';
const __version = '3.7.1';
const __commitHash = 'e1ae91405f8691c37e19e6673c6f526da63062a9';
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, asyncModelRun, modelRun, scheduledModelRun, commands, scheduler, schedulerFor, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, toStringMethod, hasToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, Random, Stream, stream, createDepthIdentifier, };
const __version = '3.8.0';
const __commitHash = '848efcecfc3d79febeed860f037fdcbe86a49171';
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, gen, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, asyncModelRun, modelRun, scheduledModelRun, commands, scheduler, schedulerFor, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, toStringMethod, hasToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, Random, Stream, stream, createDepthIdentifier, };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sparseArray = exports.array = exports.subarray = exports.shuffledSubarray = exports.clone = exports.oneof = exports.option = exports.mapToConstant = exports.constantFrom = exports.constant = exports.lorem = exports.base64String = exports.hexaString = exports.fullUnicodeString = exports.unicodeString = exports.stringOf = exports.string16bits = exports.asciiString = exports.string = exports.mixedCase = exports.base64 = exports.hexa = exports.fullUnicode = exports.unicode = exports.char16bits = exports.ascii = exports.char = exports.bigUint = exports.bigInt = exports.bigUintN = exports.bigIntN = exports.maxSafeNat = exports.maxSafeInteger = exports.nat = exports.integer = exports.double = exports.float = exports.falsy = exports.boolean = exports.asyncProperty = exports.property = exports.PreconditionFailure = exports.pre = exports.assert = exports.check = exports.statistics = exports.sample = exports.__commitHash = exports.__version = exports.__type = void 0;
exports.Value = exports.Arbitrary = exports.schedulerFor = exports.scheduler = exports.commands = exports.scheduledModelRun = exports.modelRun = exports.asyncModelRun = exports.bigUint64Array = exports.bigInt64Array = exports.float64Array = exports.float32Array = exports.uint32Array = exports.int32Array = exports.uint16Array = exports.int16Array = exports.uint8ClampedArray = exports.uint8Array = exports.int8Array = exports.uuidV = exports.uuid = exports.emailAddress = exports.webUrl = exports.webQueryParameters = exports.webPath = exports.webFragments = exports.webSegment = exports.webAuthority = exports.domain = exports.ipV6 = exports.ipV4Extended = exports.ipV4 = exports.date = exports.context = exports.func = exports.compareFunc = exports.compareBooleanFunc = exports.memo = exports.letrec = exports.unicodeJsonValue = exports.unicodeJson = exports.jsonValue = exports.json = exports.object = exports.anything = exports.dictionary = exports.record = exports.tuple = exports.uniqueArray = exports.infiniteStream = void 0;
exports.createDepthIdentifier = exports.stream = exports.Stream = exports.Random = exports.ExecutionStatus = exports.resetConfigureGlobal = exports.readConfigureGlobal = exports.configureGlobal = exports.VerbosityLevel = exports.hash = exports.asyncDefaultReportMessage = exports.defaultReportMessage = exports.asyncStringify = exports.stringify = exports.getDepthContextFor = exports.hasAsyncToStringMethod = exports.asyncToStringMethod = exports.hasToStringMethod = exports.toStringMethod = exports.hasCloneMethod = exports.cloneIfNeeded = exports.cloneMethod = void 0;
exports.Arbitrary = exports.schedulerFor = exports.scheduler = exports.commands = exports.scheduledModelRun = exports.modelRun = exports.asyncModelRun = exports.bigUint64Array = exports.bigInt64Array = exports.float64Array = exports.float32Array = exports.uint32Array = exports.int32Array = exports.uint16Array = exports.int16Array = exports.uint8ClampedArray = exports.uint8Array = exports.int8Array = exports.uuidV = exports.uuid = exports.emailAddress = exports.webUrl = exports.webQueryParameters = exports.webPath = exports.webFragments = exports.webSegment = exports.webAuthority = exports.domain = exports.ipV6 = exports.ipV4Extended = exports.ipV4 = exports.date = exports.gen = exports.context = exports.func = exports.compareFunc = exports.compareBooleanFunc = exports.memo = exports.letrec = exports.unicodeJsonValue = exports.unicodeJson = exports.jsonValue = exports.json = exports.object = exports.anything = exports.dictionary = exports.record = exports.tuple = exports.uniqueArray = exports.infiniteStream = void 0;
exports.createDepthIdentifier = exports.stream = exports.Stream = exports.Random = exports.ExecutionStatus = exports.resetConfigureGlobal = exports.readConfigureGlobal = exports.configureGlobal = exports.VerbosityLevel = exports.hash = exports.asyncDefaultReportMessage = exports.defaultReportMessage = exports.asyncStringify = exports.stringify = exports.getDepthContextFor = exports.hasAsyncToStringMethod = exports.asyncToStringMethod = exports.hasToStringMethod = exports.toStringMethod = exports.hasCloneMethod = exports.cloneIfNeeded = exports.cloneMethod = exports.Value = void 0;
const Pre_1 = require("./check/precondition/Pre");

@@ -18,2 +18,4 @@ Object.defineProperty(exports, "pre", { enumerable: true, get: function () { return Pre_1.pre; } });

Object.defineProperty(exports, "statistics", { enumerable: true, get: function () { return Sampler_1.statistics; } });
const gen_1 = require("./arbitrary/gen");
Object.defineProperty(exports, "gen", { enumerable: true, get: function () { return gen_1.gen; } });
const array_1 = require("./arbitrary/array");

@@ -230,5 +232,5 @@ Object.defineProperty(exports, "array", { enumerable: true, get: function () { return array_1.array; } });

exports.__type = __type;
const __version = '3.7.1';
const __version = '3.8.0';
exports.__version = __version;
const __commitHash = 'e1ae91405f8691c37e19e6673c6f526da63062a9';
const __commitHash = '848efcecfc3d79febeed860f037fdcbe86a49171';
exports.__commitHash = __commitHash;

@@ -9,2 +9,3 @@ import { pre } from './check/precondition/Pre';

import { sample, statistics } from './check/runner/Sampler';
import { gen, GeneratorValue } from './arbitrary/gen';
import { array, ArrayConstraints } from './arbitrary/array';

@@ -121,3 +122,3 @@ import { bigInt, BigIntConstraints } from './arbitrary/bigInt';

/**
* Version of fast-check used by your project (eg.: 3.7.1)
* Version of fast-check used by your project (eg.: 3.8.0)
* @remarks Since 1.22.0

@@ -128,3 +129,3 @@ * @public

/**
* Commit hash of the current code (eg.: e1ae91405f8691c37e19e6673c6f526da63062a9)
* Commit hash of the current code (eg.: 848efcecfc3d79febeed860f037fdcbe86a49171)
* @remarks Since 2.7.0

@@ -134,2 +135,2 @@ * @public

declare const __commitHash: string;
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, IRawProperty, IProperty, IPropertyWithHooks, IAsyncProperty, IAsyncPropertyWithHooks, AsyncPropertyHookFunction, PropertyHookFunction, PropertyFailure, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, AsyncCommand, Command, ICommand, asyncModelRun, modelRun, scheduledModelRun, commands, ModelRunSetup, ModelRunAsyncSetup, scheduler, schedulerFor, Scheduler, SchedulerSequenceItem, SchedulerReportItem, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, WithCloneMethod, toStringMethod, hasToStringMethod, WithToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, WithAsyncToStringMethod, DepthContext, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, ArrayConstraints, BigIntConstraints, BigIntArrayConstraints, BigUintConstraints, CommandsContraints, DateConstraints, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, FalsyContraints, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, LoremConstraints, MixedCaseConstraints, NatConstraints, ObjectConstraints, OneOfConstraints, OptionConstraints, RecordConstraints, SchedulerConstraints, UniqueArrayConstraints, UniqueArraySharedConstraints, UniqueArrayConstraintsRecommended, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, SparseArrayConstraints, StringSharedConstraints, SubarrayConstraints, ShuffledSubarrayConstraints, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, MaybeWeightedArbitrary, WeightedArbitrary, LetrecTypedTie, LetrecTypedBuilder, LetrecLooselyTypedTie, LetrecLooselyTypedBuilder, CloneValue, ContextValue, FalsyValue, JsonValue, LetrecValue, OneOfValue, RecordValue, Memo, Size, SizeForArbitrary, DepthSize, GlobalParameters, GlobalAsyncPropertyHookFunction, GlobalPropertyHookFunction, Parameters, RandomType, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, ExecutionTree, RunDetails, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsFailureInterrupted, RunDetailsSuccess, RunDetailsCommon, Random, Stream, stream, DepthIdentifier, createDepthIdentifier, };
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, IRawProperty, IProperty, IPropertyWithHooks, IAsyncProperty, IAsyncPropertyWithHooks, AsyncPropertyHookFunction, PropertyHookFunction, PropertyFailure, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, gen, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, AsyncCommand, Command, ICommand, asyncModelRun, modelRun, scheduledModelRun, commands, ModelRunSetup, ModelRunAsyncSetup, scheduler, schedulerFor, Scheduler, SchedulerSequenceItem, SchedulerReportItem, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, WithCloneMethod, toStringMethod, hasToStringMethod, WithToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, WithAsyncToStringMethod, DepthContext, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, ArrayConstraints, BigIntConstraints, BigIntArrayConstraints, BigUintConstraints, CommandsContraints, DateConstraints, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, FalsyContraints, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, LoremConstraints, MixedCaseConstraints, NatConstraints, ObjectConstraints, OneOfConstraints, OptionConstraints, RecordConstraints, SchedulerConstraints, UniqueArrayConstraints, UniqueArraySharedConstraints, UniqueArrayConstraintsRecommended, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, SparseArrayConstraints, StringSharedConstraints, SubarrayConstraints, ShuffledSubarrayConstraints, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, MaybeWeightedArbitrary, WeightedArbitrary, LetrecTypedTie, LetrecTypedBuilder, LetrecLooselyTypedTie, LetrecLooselyTypedBuilder, CloneValue, ContextValue, FalsyValue, GeneratorValue, JsonValue, LetrecValue, OneOfValue, RecordValue, Memo, Size, SizeForArbitrary, DepthSize, GlobalParameters, GlobalAsyncPropertyHookFunction, GlobalPropertyHookFunction, Parameters, RandomType, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, ExecutionTree, RunDetails, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsFailureInterrupted, RunDetailsSuccess, RunDetailsCommon, Random, Stream, stream, DepthIdentifier, createDepthIdentifier, };
{
"name": "fast-check",
"version": "3.7.1",
"version": "3.8.0",
"description": "Property based testing framework for JavaScript (like QuickCheck)",

@@ -61,4 +61,4 @@ "type": "commonjs",

"@microsoft/api-extractor": "^7.34.4",
"@types/jest": "^29.4.0",
"@types/node": "^18.15.1",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.10",
"buffer": "^6.0.3",

@@ -69,3 +69,3 @@ "cross-env": "^7.0.3",

"ts-jest": "^29.0.5",
"typedoc": "^0.23.26",
"typedoc": "^0.23.28",
"typescript": "^4.9.5"

@@ -72,0 +72,0 @@ },

@@ -94,2 +94,3 @@ <h1 align="center">

- **Extendable:** precondition checks with `fc.pre(...)` \[[more](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/documentation/Tips.md#filter-invalid-combinations-using-pre-conditions)\] - _filtering invalid entries can be done directly inside the check function if needed_
- **Extendable:** easily switch from fake data in tests to property based with `fc.gen()` \[[more](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/documentation/Tips.md#generate-random-values-during-the-predicate)\] - _generate random values within your predicates_
- **Smart:** ability to shrink on `fc.oneof` \[[more](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/documentation/Arbitraries.md#combinors-of-arbitraries-t)\] - _surprisingly some frameworks don't_

@@ -96,0 +97,0 @@ - **Smart:** biased by default \[[more](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/documentation/AdvancedArbitraries.md#biased-arbitraries)\] - _by default it generates both small and large values, making it easier to dig into counterexamples without having to tweak a size parameter manually_

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