unstale

npm / fast-check

fast-check

What changed in fast-check 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-22.

48 breaking1 security7 deprecations20 new APIs and options18 performance9 behavior and defaults2 tooling19 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

fast-check 4124 changes

Breaking changes 48

  • Typed array arbitraries now use the ArrayBuffer generic in their type.

    4.0.0release notes

  • The deprecated ascii* arbitraries are removed; code using them must migrate.

    4.0.0release notes

  • The deprecated big{U|}int{N|} arbitraries are removed; code using them must migrate.

    4.0.0release notes

  • The cloneMethod symbol is no longer included in CommandsIterable TypeScript typings.

    4.0.0upgrade guide

  • The asyncToStringMethod symbol method is no longer exposed in CommandWrapper TypeScript typings, though it still exists in JavaScript.

    4.0.0upgrade guide

  • The toStringMethod symbol method is no longer exposed in CommandWrapper TypeScript typings, though it still exists in JavaScript.

    4.0.0upgrade guide

  • The minimum supported ECMAScript specification is now ES2020, up from ES2017.

    4.0.0upgrade guide

  • When a predicate throws an Error, fast-check now attaches the original error as a cause instead of combining its message with failure details.

    4.0.0upgrade guiderelease notes

  • The produced bundle targets ES2020.

    4.0.0release notes

  • The single-character ascii arbitrary was removed; use fc.string with unit 'binary-ascii' and length constraints.

    4.0.0upgrade guide

  • The specialized ASCII string arbitrary was removed; use fc.string with unit 'binary-ascii'.

    4.0.0upgrade guide

  • The base64 arbitrary was removed; the notes show how to construct equivalent character values with constantFrom or a mapped integer arbitrary.

    4.0.0upgrade guiderelease notes

  • The bigIntN arbitrary was removed; use fc.bigInt instead.

    4.0.0upgrade guide

  • The bigUint arbitrary was removed; use fc.bigInt instead.

    4.0.0upgrade guide

  • The bigUintN arbitrary was removed; use fc.bigInt instead.

    4.0.0upgrade guide

  • The single-character char arbitrary was removed; use fc.string with unit 'grapheme-ascii' and length constraints.

    4.0.0upgrade guiderelease notes

  • The single-character char16bits arbitrary was removed; the notes show how to recreate it with nat and String.fromCharCode.

    4.0.0upgrade guiderelease notes

  • By default, the date arbitrary can now generate Invalid Date; set noInvalidDate to true to exclude invalid dates.

    4.0.0upgrade guide

  • By default, generated objects may have null prototypes; set noNullPrototype to true to require the usual Object prototype.

    4.0.0upgrade guiderelease notes

  • The single-character fullUnicode arbitrary was removed; use fc.string with unit 'binary' and length constraints.

    4.0.0upgrade guide

  • The specialized fullUnicodeString arbitrary was removed; use fc.string with unit 'binary'.

    4.0.0upgrade guide

  • The single-character hexa arbitrary was removed; the notes show how to recreate it with a mapped integer arbitrary.

    4.0.0upgrade guide

  • The specialized hexaString arbitrary was removed; use fc.string with a custom unit.

    4.0.0upgrade guide

  • The Arbitrary.noBias method was replaced by the standalone fc.noBias arbitrary.

    4.0.0upgrade guide

  • The deprecated withDeletedKeys flag has been removed; use requiredKeys instead.

    4.0.0upgrade guiderelease notes

  • By default, generated objects may have null prototypes; set noNullPrototype to true to require the usual Object prototype.

    4.0.0upgrade guiderelease notes

  • The specialized string16bits arbitrary was removed; use fc.string with a custom unit.

    4.0.0upgrade guiderelease notes

  • The single-character unicode arbitrary was removed; the notes show how to recreate it with integer mapping.

    4.0.0upgrade guide

  • The unicodeJson arbitrary was replaced by fc.json, which accepts a stringUnit constraint to configure the character set.

    4.0.0upgrade guide

  • The unicodeJsonValue arbitrary was replaced by fc.jsonValue, which accepts a stringUnit constraint to configure the character set.

    4.0.0upgrade guide

  • The specialized unicodeString arbitrary was removed; use fc.string with a custom unit.

    4.0.0upgrade guide

  • The default UUID versions now include 6, 7, and 8 in addition to versions 1 through 5; specify version to restrict the generated versions.

    4.0.0upgrade guiderelease notes

  • The deprecated fullUnicode* arbitraries are removed; code using them must migrate.

    4.0.0release notes

  • The deprecated hexa* arbitraries are removed; code using them must migrate.

    4.0.0release notes

  • Enable this flag to retain the previous behavior of combining fast-check failure details with the original error message.

    4.0.0upgrade guide

  • Invalid dates are included by default, changing the values generated by the relevant arbitrary.

    4.0.0release notes

  • The deprecated noBias API is removed; code using it must migrate.

    4.0.0release notes

  • The minimum supported Node version is now 12.17.0, up from 8.

    4.0.0upgrade guiderelease notes

  • The deprecated noShrink API is removed; code using it must migrate.

    4.0.0release notes

  • Property executors must explicitly call runBeforeEach and runAfterEach; custom property runners and IRawProperty implementations may be affected.

    4.0.0upgrade guide

  • The nextArrayInt method was dropped from Random; use nextBigInt for big numerical values.

    4.0.0upgrade guiderelease notes

  • The error field was removed from the RunDetails object returned by fc.check; use errorInstance instead.

    4.0.0upgrade guide

  • Null-prototype objects now serialize using an object literal with __proto__:null rather than Object.create(null) or Object.assign.

    4.0.0upgrade guide

  • The deprecated stringOf arbitrary is removed; code using it must migrate.

    4.0.0release notes

  • The minimum optional TypeScript version is now 5.0, up from 4.1.

    4.0.0upgrade guide

  • The deprecated unicode* arbitraries are removed; code using them must migrate.

    4.0.0release notes

  • The deprecated unicodeJson* arbitraries are removed; code using them must migrate.

    4.0.0release notes

  • The deprecated uuidV arbitrary is removed; code using it must migrate.

    4.0.0release notes

Security 1

Deprecations 7

  • The asyncReporter parameter is deprecated.

    4.10.0release notes

  • Life-cycle methods are deprecated in favor of plugin-based lifecycle hooks.

    4.10.0release notes

  • Parameters superseded by plugins are deprecated.

    4.10.0release notes

  • The reporter parameter is deprecated.

    4.10.0release notes

  • The timeout parameter is deprecated in favor of the timeout plugin.

    4.10.0release notes

  • Random.next(n) is deprecated.

    4.6.0release notes

  • Random.nextInt() is deprecated.

    4.6.0release notes

New APIs and options 20

  • Adds an afterEach plugin for lifecycle hooks.

    4.10.0release notes

  • Adds a plugin for hooking into the lifecycle, with support for teardown.

    4.10.0release notes

  • Adds plugins that drop runs on cases that are already covered.

    4.10.0release notes

  • Plugins can decorate generate.

    4.10.0release notes

  • Plugins can now be configured globally.

    4.10.0release notes

  • Adds an extra plugin method called after all runs complete.

    4.10.0release notes

  • Introduces a plugin API for extending fast-check behavior.

    4.10.0release notes

  • The plugin supports failOnInterrupt.

    4.10.0release notes

  • Plugins are passed a store.

    4.10.0release notes

  • Adds a plugin to interrupt after a time limit.

    4.10.0release notes

  • Adds a plugin to stop long-running predicates.

    4.10.0release notes

  • Adds a plugin to generate without bias.

    4.10.0release notes

  • Adds the chainUntil arbitrary for iterative chaining.

    4.8.0release notes

  • The json arbitrary is reversible, allowing generated JSON values to be reversed.

    4.7.0release notes

  • Adds basic maxLength support to stringMatching, allowing developers to constrain generated strings by length.

    4.6.0release notes

  • Adds entityGraph for generating schema-based structures.

    4.5.0release notes

  • Adds initial pool constraints to entityGraph.

    4.5.0release notes

  • Adds strategies to entityGraph.

    4.5.0release notes

  • Adds the fc.map arbitrary.

    4.4.0release notes

  • Adds the fc.set arbitrary.

    4.4.0release notes

Performance 18

  • Initialization and memory performance of binary strings are improved.

    4.10.3release notes

  • Repeated string tokenization states are avoided.

    4.10.3release notes

  • Uses a single timer for interruptAfterTimeLimit.

    4.10.0release notes

  • fc.dictionary is faster on generate.

    4.9.0release notes

  • fc.entityGraph is faster on generate, with an early exit on an empty tuple.

    4.9.0release notes

  • fc.integer is faster on generate.

    4.9.0release notes

  • fc.record is faster on generate, and nested tuple is dropped for generate.

    4.9.0release notes

  • fc.stringMatching is faster for \W, \D, \S, and . and faster on generate.

    4.9.0release notes

  • fc.webPath is faster on generate.

    4.9.0release notes

  • fc.webUrl is faster on generate.

    4.9.0release notes

  • Optimizes array allocations in RunDetailsFormatter.

    4.6.0release notes

  • Uses Math.imul and shifts in performance-critical paths.

    4.4.0release notes

  • Error stack computation is delayed when there is no cause.

    4.0.0release notes

  • ipV6 generation is faster using cached string builders.

    4.0.0release notes

  • mixedCase no longer performs an unneeded BigInt check.

    4.0.0release notes

  • property.run is faster with strict equality checks.

    4.0.0release notes

  • Race-condition schedulers are faster.

    4.0.0release notes

  • Scheduling with scheduleSequence is faster.

    4.0.0release notes

Behavior and default changes 9

  • entityGraph is being made shrinkable thanks to chainUntil.

    4.9.0release notes

  • stringMatching supports Unicode property escapes, including negated properties.

    4.7.0release notes

  • Allows recursions on many relations in entityGraph.

    4.5.0release notes

  • Tweaks the uniqueness of entities produced by entityGraph.

    4.5.0release notes

  • Supports inverse relations in entityGraph.

    4.5.0release notes

  • fc.dictionary(...) now supports the full PropertyKey type for keys.

    4.4.0release notes

  • Type inference now preserves a literal type for fc.constant('a') without an explicit generic argument.

    4.0.0upgrade guiderelease notes

  • Type inference now produces a union of literal types for fc.constantFrom('a', 'b') without an explicit generic argument.

    4.0.0upgrade guiderelease notes

  • Stringified null-prototype values are shorter, changing their displayed representation.

    4.0.0release notes

Tooling 2

Fixes and other changes 19

  • Unicode regexes now handle escaped surrogate pairs.

    4.10.3release notes

  • Regexes now support non-Unicode x and u identity escapes.

    4.10.3release notes

  • Regex character ranges now preserve NUL code points.

    4.10.3release notes

  • NUL escapes are parsed as characters instead of backreferences.

    4.10.3release notes

  • Clones of a scheduler now run tasks in the same order.

    4.10.3release notes

  • Regexes now support full Unicode code-point escapes.

    4.10.3release notes

  • Unicode regex ranges are shrunk using full code points.

    4.10.3release notes

  • Fixes a bug where the interruptAfterTimeLimit plugin crashes.

    4.10.2release notes

  • Fixes timer capture for the interruptAfterTimeLimit plugin.

    4.10.1release notes

  • Fixes ordering between plugins.

    4.10.0release notes

  • Fixes a latent state-sharing bug in entityGraph.

    4.9.0release notes

  • Alternatives in stringMatching are now equiprobable.

    4.9.0release notes

  • Restores the ability to use fast-check without enabling skipLibCheck.

    4.8.0release notes

  • Fixes a bad TypeScript declaration import in BuildInversedRelationsMapping.

    4.6.0release notes

  • Fixes object unmapping and depth computation for special keys.

    4.6.0release notes

  • Prevents crashes when stringifying detached ArrayBuffers.

    4.6.0release notes

  • Improves clamping of regular expressions when maxLength is used with stringMatching.

    4.6.0release notes

  • Takes depth into account when generating entity graphs.

    4.5.0release notes

  • Rejection handling in scheduleSequence is improved.

    4.0.0release notes