Issue with `toMatchInlineSnapshot()` in `@effect/vitest` Integration

I've been trying to make use of @vitest/effect with some success. Currently I am struggling with expect(..).toMatchInlineSnapshot() and friends, which does not seem to work correctly.

I get: TypeError: Cannot read properties of undefined (reading 'environment')

See:

import * as vi from "vitest"

vi.it("test", (cx) =>
  Effect.gen(function* () {
    cx.expect(1).toMatchInlineSnapshot(`1`);
  }).pipe(Effect.runPromise),
);


this works, but:

import {it} from "@effect/vitest";

it.effect("test", (cx) =>
  Effect.gen(function* () {
    cx.expect(1).toMatchInlineSnapshot();
  }),
);


fails with:

TypeError: Cannot read properties of undefined (reading 'match')
Was this page helpful?