Repository navigation
feat(rstest): add @effect/rstest package - #7976
ScriptedAlchemy wants to merge 2 commits into
Conversation
Add @effect/rstest, the Rstest counterpart of @effect/vitest. The public API mirrors @effect/vitest (it.effect, it.live, it.layer, it.prop, it.flakyTest, describeWrapped, makeMethods, addEqualityTesters, @effect/rstest/utils) on top of @rstest/core, with the runner-specific differences documented in the README.
🦋 Changeset detectedLatest commit: 49d778e The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 445937f7f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
- `run` returns `Promise<void>` via `Effect.asVoid` instead of `Promise<any>`,
removing the `as any` in `each`
- `{ fails: true }` is mapped to `it.fails` for skip/only/skipIf/runIf/each too,
not only the base tester and `prop`
- `testOptions` matches the vitest one-liner (rstest ignores unknown keys)
- trim comments to the surrounding style; simplify the re-export typetest
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Feel free to make this a community package :) We don't want to take on the maintenance burden at this time. |
Summary
Adds
@effect/rstest(packages/rstest), the Rstest counterpart of@effect/vitest.Rstest is intentionally Vitest-compatible, so the package is a near line-for-line port of the current
@effect/vitest(including the nativeArbitraryproperty-testing runner from #7254) withvitestswapped for@rstest/core. The public API is the same:itwitheffect,live,layer,prop,flakyTesteffect,live,layer,prop,flakyTest,addEqualityTesters,makeMethods,describeWrapped@effect/rstest/utilsassertion helpers (identical to@effect/vitest/utils)@rstest/coreThis has been living as a community package (
ScriptedAlchemy/effect-rstest) and is used in production test suites; upstreaming it keeps it in lockstep with@effect/vitestand Effect v4 releases.Differences forced by the runner
Documented in
packages/rstest/README.mdunder "Differences from@effect/vitest":describeWrappedreturnsvoid— Rstest'sdescribereturns noSuiteCollectorand its callback receives noit.layer(...)((it) => ...)blocks — Rstest exposes nogetCurrentSuite(), so the block's tests can't be enumerated like@effect/vitestdoes. An empty nesteddescribe("")is used as the lifecycle boundary instead (Rstest omits empty suite names from test paths;beforeAll/afterAllbuild and release the layer around the block).test/isolation.test.tshas a regression test for the release boundary.it.describe— Rstest'sithas nodescribe, so the enhanceditattaches the runner'sdescribeto keepit.describe.each(...)working.{ fails: true }in test options — Rstest only readstimeout/retry/repeats/metafrom the options object, sofailsis mapped onto theit.failsmodifier (Vitest.TestOptionsadds it to the type).skipIf/runIf— Rstest types the condition asboolean; the public API still acceptsunknownand coerces.Vitest(Vitest.Methods, ...) so test files can move between the two packages without touching type imports.Monorepo wiring
tsconfig.packages.jsonreference,tsconfig.tests.jsonpath alias (+**/rstest.*.tsinclude), rootdevDependency.changeset/config.json: added to the fixed group so it versions with@effect/vitest; version set to4.0.0-rc.112to matchdeno.json: exclude**/rstest.*.tslike the vitest configsTest (Rstest)CI job runningpnpm --filter @effect/rstest test. The Rstest suite cannot run under the root Vitest projects, so it is not part ofpnpm test@rstest/corepinned to0.11.10as devDependency (peer>=0.11.0 <1.0.0);0.11.12is newer than the pnpmminimumReleaseAgegateVerification
pnpm check(repo-wide, includespackages/rstest/{test,typetest})pnpm --filter @effect/rstest test— 57 tests, 52 passed, 5 skipped (the same skipped cases as@effect/vitest)pnpm test-types --target '>=5.9'— 172 files incl.packages/rstest/typetest/index.tst.tspnpm lint,pnpm circular,pnpm --filter @effect/rstest build,node scripts/copy-ai-docs.mjspnpm vitest run --project @effect/vitestunchanged (44 passed, 5 expected fail, 5 skipped)deno check .was not run locally (no Deno installed); relying on the Types CI job