Testing Effects in `bun:test`: Best Practices and Alternatives

Is there an equivalent to @effect/vitest for bun:test? If not, is the proper test design to write
test("it should run an effect", async () => {
  const result = await runPromiseExit(Effect.gen(function*() {
    // some effect code
  }));
  expect(result)...
});

or do you wrap every test in one big generator and run that, like
const effect = Effect.gen(function*() {
  test("should run an effect", () => {
    const result = yield* SomeDependency
    expect(result)...
  });
  test("should run another effect", () => {
    const result = yield* AnotherDependency
    expect(result)...
  });
});

runSync(effect)
Was this page helpful?