Skip to content

feat!: port property tests to effect/unstable/arbitrary - #7

Open
BleedingDev wants to merge 1 commit into
Nsttt:mainfrom
BleedingDev:feat/effect-rc113-arbitrary
Open

BleedingDev wants to merge 1 commit into
Nsttt:mainfrom
BleedingDev:feat/effect-rc113-arbitrary

Conversation

@BleedingDev

@BleedingDev BleedingDev commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Effect-TS/effect#7254 | ScriptedAlchemy/effect-rstest#5

Why the change

Effect 4.0.0-rc.113 removed effect/testing/FastCheck, so effect-rstest@0.1.5 fails to import on current Effect, so this PR moves the property-test helpers to effect/unstable/arbitrary, as upstream @effect/vitest did.

Special things to note

  • Breaking change (feat!): the fastCheck option is now arbitrary (Arbitrary.CheckOptions), and the effect peer range is now >=4.0.0-rc.113 <5.0.0.
  • With the current release-please config, a breaking change on 0.x proposes 1.0.0. To ship 0.2.0 instead, add "bump-minor-pre-major": true or a Release-As: 0.2.0 footer when merging.
  • The same port already landed in feat!: port prop to effect/unstable/arbitrary (effect rc.113+) ScriptedAlchemy/effect-rstest#5. We'd like to install it from npm instead of pkg.pr.new previews.

Change outline

Files changed:

  package.json            ~ effect peer >=4.0.0-rc.113, dev pin 4.0.0-rc.117
  pnpm-lock.yaml          - fast-check removed
  src/
    index.ts              ~ option types: fastCheck -> arbitrary
    internal/internal.ts  ~ FC.* -> Arbitrary.*
  test/ + typetest/       ~ updated to the new API, plus a test for a property that returns false
  README.md               ~ migration notes

How a property test runs now:

  it.prop(name, inputs, property, options)
    inputs (Schema | Arbitrary, as a tuple or a record)
-     Schema.toArbitrary(input)(FC)  ->  FC.tuple / FC.record
+     Arbitrary.schema(input)        ->  Arbitrary.all(...)
-   FC.assert(FC.asyncProperty(...), options.fastCheck)
+   runTest(ctx)(Arbitrary.checkEffect(arbitrary, property, options.arbitrary))
+     failure -> Effect.die(new Error(Arbitrary.formatCheckFailure(result)))

Failing properties still shrink. The test timeout now also interrupts generation and shrinking.

What changes for users:

- { fastCheck: { numRuns: 5, seed: 1001 } }
+ { arbitrary: { runs: 5, seed: 1001 } }

Test plan

  • pnpm check, pnpm test (105 passed), pnpm build, pnpm test:types (TS 5.9 and 6.0)

🤖 Generated with Claude Code

Effect 4.0.0-rc.113 removed effect/testing/FastCheck, so effect-rstest
0.1.x fails to import on current Effect releases. Build property inputs
with Arbitrary.schema/Arbitrary.all and run them through
Arbitrary.checkEffect, which keeps shrinking and lets the test timeout
interrupt generation and shrinking.

BREAKING CHANGE: requires effect >=4.0.0-rc.113. Property inputs are
Schema or Arbitrary values from effect/unstable/arbitrary, and the
`fastCheck` option is replaced by `arbitrary` (Arbitrary.CheckOptions).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant