Closed dubzzz closed 3 weeks ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 048f09fc40602476190f9aaa4b9b4893c4d05ebb:
Sandbox | Source |
---|---|
@fast-check/examples | Configuration |
👋 A preview of the new documentation is available at: http://66c8d397f02c1bf06d16b818--dubzzz-fast-check.netlify.app
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.32%. Comparing base (
a14bc3a
) to head (048f09f
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Waiting for https://github.com/yarnpkg/berry/pull/6461
Latest commit: 048f09fc40602476190f9aaa4b9b4893c4d05ebb
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
👋 A preview of the new documentation is available at: http://66c98ff69d7767a033ca991f--dubzzz-fast-check.netlify.app
Description
This PR deprecates all our past arbitraries of single characters. We recommend to replace them by arbitraries on strings with
minLength
andmaxLength
both set to1
.This PR also deprecates all string arbitraries except
string
,base64String
,stringMatching
andmixedCase
. All the deprecated arbitraries could now be expressed usingfc.string
with a specificunit
. Here are our recommended migration paths:asciiString
can be replaced byfc.string({ unit: 'binary-ascii' })
(identical behavior).unicodeString
does not have direct equivalent in the recommended world, we either recommend you to build a custom unit arbitrary (see 1 below) or to rely on existing units provided byfc.string
. Depending on what you wanted to achieve when selectingfc.unicode
you may go for either'grapheme'
and related or'binary'
and related. On our side, we rather recommend to rely on'grapheme'
and related builders as they better fit with the definition of what is a grapheme from an Unicode point of view.string16bits
does not have direct equivalent in the recommended world (you may read the text written above forunicodeString
for more recommendations). See 2 below for an exact conversion.fullUnicodeString
can be replaced byfc.string({ unit: 'binary' })
(identical behavior), that said we rather recommend you to go forfc.string({ unit: 'grapheme' })
orfc.string({ unit: 'grapheme-composite' })
.hexaString
does not have direct equivalent in the recommended world. See 3 below for an exact conversion.(1) Converting
unicodeString
tostring
:(2) Converting
string16bits
tostring
:(3) Converting
hexaString
tostring
:Checklist — Don't delete this checklist and make sure you do the following before opening the PR
yarn bump
and flag the impacts properlyAdvanced