Type Error in Vitest: Missing TestContext in Custom Service Injection

Vitest missing TestContext in type.

I have the following Test (which i'm sure is probably not a great test cause i'm providing services which not sure if thats ok in unit test.

import { expect, it } from "@effect/vitest";
import { Effect } from "effect";
import { Fetch, FetchTest } from "./fetch.js";
import { FRConfigTest } from "./Config.js";

it.effect("should fetch a route", () =>
  Effect.gen(function* () {
    const { get } = yield* Fetch;
    const todos = yield* get("/todos");
    expect(todos).toStrictEqual({});
  }).pipe(Effect.provide(FetchTest), Effect.provide(FRConfigTest)),
);


The test passes but I get a type error:

 Type 'Effect<void, unknown, unknown>' is not assignable to type 'Effect<void, unknown, TestServices>'.
     │        Type 'unknown' is not assignable to type 'TestServices'.


My understanding was that TestServices was auto injected, however i'm guessing because I am manually providing here its overriding it? (shot in the dark)
Was this page helpful?