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 initfast-check 4124 changes
Breaking changes 48
Typed array arbitraries now use the ArrayBuffer generic in their type.
The deprecated ascii* arbitraries are removed; code using them must migrate.
The deprecated big{U|}int{N|} arbitraries are removed; code using them must migrate.
The cloneMethod symbol is no longer included in CommandsIterable TypeScript typings.
The asyncToStringMethod symbol method is no longer exposed in CommandWrapper TypeScript typings, though it still exists in JavaScript.
The toStringMethod symbol method is no longer exposed in CommandWrapper TypeScript typings, though it still exists in JavaScript.
The minimum supported ECMAScript specification is now ES2020, up from ES2017.
When a predicate throws an Error, fast-check now attaches the original error as a cause instead of combining its message with failure details.
The produced bundle targets ES2020.
The single-character ascii arbitrary was removed; use fc.string with unit 'binary-ascii' and length constraints.
The specialized ASCII string arbitrary was removed; use fc.string with unit 'binary-ascii'.
The base64 arbitrary was removed; the notes show how to construct equivalent character values with constantFrom or a mapped integer arbitrary.
The bigIntN arbitrary was removed; use fc.bigInt instead.
The bigUint arbitrary was removed; use fc.bigInt instead.
The bigUintN arbitrary was removed; use fc.bigInt instead.
The single-character char arbitrary was removed; use fc.string with unit 'grapheme-ascii' and length constraints.
The single-character char16bits arbitrary was removed; the notes show how to recreate it with nat and String.fromCharCode.
By default, the date arbitrary can now generate Invalid Date; set noInvalidDate to true to exclude invalid dates.
By default, generated objects may have null prototypes; set noNullPrototype to true to require the usual Object prototype.
The single-character fullUnicode arbitrary was removed; use fc.string with unit 'binary' and length constraints.
The specialized fullUnicodeString arbitrary was removed; use fc.string with unit 'binary'.
The single-character hexa arbitrary was removed; the notes show how to recreate it with a mapped integer arbitrary.
The specialized hexaString arbitrary was removed; use fc.string with a custom unit.
The Arbitrary.noBias method was replaced by the standalone fc.noBias arbitrary.
The deprecated withDeletedKeys flag has been removed; use requiredKeys instead.
By default, generated objects may have null prototypes; set noNullPrototype to true to require the usual Object prototype.
The specialized string16bits arbitrary was removed; use fc.string with a custom unit.
The single-character unicode arbitrary was removed; the notes show how to recreate it with integer mapping.
The unicodeJson arbitrary was replaced by fc.json, which accepts a stringUnit constraint to configure the character set.
The unicodeJsonValue arbitrary was replaced by fc.jsonValue, which accepts a stringUnit constraint to configure the character set.
The specialized unicodeString arbitrary was removed; use fc.string with a custom unit.
The default UUID versions now include 6, 7, and 8 in addition to versions 1 through 5; specify version to restrict the generated versions.
The deprecated fullUnicode* arbitraries are removed; code using them must migrate.
The deprecated hexa* arbitraries are removed; code using them must migrate.
Enable this flag to retain the previous behavior of combining fast-check failure details with the original error message.
Invalid dates are included by default, changing the values generated by the relevant arbitrary.
The deprecated noBias API is removed; code using it must migrate.
The minimum supported Node version is now 12.17.0, up from 8.
The deprecated noShrink API is removed; code using it must migrate.
Property executors must explicitly call runBeforeEach and runAfterEach; custom property runners and IRawProperty implementations may be affected.
The nextArrayInt method was dropped from Random; use nextBigInt for big numerical values.
The error field was removed from the RunDetails object returned by fc.check; use errorInstance instead.
Null-prototype objects now serialize using an object literal with __proto__:null rather than Object.create(null) or Object.assign.
The deprecated stringOf arbitrary is removed; code using it must migrate.
The minimum optional TypeScript version is now 5.0, up from 4.1.
The deprecated unicode* arbitraries are removed; code using them must migrate.
The deprecated unicodeJson* arbitraries are removed; code using them must migrate.
The deprecated uuidV arbitrary is removed; code using it must migrate.
Security 1
json resists external poisoning.
Deprecations 7
The asyncReporter parameter is deprecated.
Life-cycle methods are deprecated in favor of plugin-based lifecycle hooks.
Parameters superseded by plugins are deprecated.
The reporter parameter is deprecated.
The timeout parameter is deprecated in favor of the timeout plugin.
Random.next(n) is deprecated.
Random.nextInt() is deprecated.
New APIs and options 20
Adds an afterEach plugin for lifecycle hooks.
Adds a plugin for hooking into the lifecycle, with support for teardown.
Adds plugins that drop runs on cases that are already covered.
Plugins can decorate generate.
Plugins can now be configured globally.
Adds an extra plugin method called after all runs complete.
Introduces a plugin API for extending fast-check behavior.
The plugin supports failOnInterrupt.
Plugins are passed a store.
Adds a plugin to interrupt after a time limit.
Adds a plugin to stop long-running predicates.
Adds a plugin to generate without bias.
Adds the chainUntil arbitrary for iterative chaining.
The json arbitrary is reversible, allowing generated JSON values to be reversed.
Adds basic maxLength support to stringMatching, allowing developers to constrain generated strings by length.
Adds entityGraph for generating schema-based structures.
Adds initial pool constraints to entityGraph.
Adds strategies to entityGraph.
Adds the fc.map arbitrary.
Adds the fc.set arbitrary.
Performance 18
Initialization and memory performance of binary strings are improved.
Repeated string tokenization states are avoided.
Uses a single timer for interruptAfterTimeLimit.
fc.dictionary is faster on generate.
fc.entityGraph is faster on generate, with an early exit on an empty tuple.
fc.integer is faster on generate.
fc.record is faster on generate, and nested tuple is dropped for generate.
fc.stringMatching is faster for \W, \D, \S, and . and faster on generate.
fc.webPath is faster on generate.
fc.webUrl is faster on generate.
Optimizes array allocations in RunDetailsFormatter.
Uses Math.imul and shifts in performance-critical paths.
Error stack computation is delayed when there is no cause.
ipV6 generation is faster using cached string builders.
mixedCase no longer performs an unneeded BigInt check.
property.run is faster with strict equality checks.
Race-condition schedulers are faster.
Scheduling with scheduleSequence is faster.
Behavior and default changes 9
entityGraph is being made shrinkable thanks to chainUntil.
stringMatching supports Unicode property escapes, including negated properties.
Allows recursions on many relations in entityGraph.
Tweaks the uniqueness of entities produced by entityGraph.
Supports inverse relations in entityGraph.
fc.dictionary(...) now supports the full PropertyKey type for keys.
Type inference now preserves a literal type for fc.constant('a') without an explicit generic argument.
Type inference now produces a union of literal types for fc.constantFrom('a', 'b') without an explicit generic argument.
Stringified null-prototype values are shorter, changing their displayed representation.
Tooling 2
Type definitions for built-in plugins are improved.
The types for fc.record are simplified.
Fixes and other changes 19
Unicode regexes now handle escaped surrogate pairs.
Regexes now support non-Unicode x and u identity escapes.
Regex character ranges now preserve NUL code points.
NUL escapes are parsed as characters instead of backreferences.
Clones of a scheduler now run tasks in the same order.
Regexes now support full Unicode code-point escapes.
Unicode regex ranges are shrunk using full code points.
Fixes a bug where the interruptAfterTimeLimit plugin crashes.
Fixes timer capture for the interruptAfterTimeLimit plugin.
Fixes ordering between plugins.
Fixes a latent state-sharing bug in entityGraph.
Alternatives in stringMatching are now equiprobable.
Restores the ability to use fast-check without enabling skipLibCheck.
Fixes a bad TypeScript declaration import in BuildInversedRelationsMapping.
Fixes object unmapping and depth computation for special keys.
Prevents crashes when stringifying detached ArrayBuffers.
Improves clamping of regular expressions when maxLength is used with stringMatching.
Takes depth into account when generating entity graphs.
Rejection handling in scheduleSequence is improved.