This error means t isn’t getting your modules, so convex-test can’t see any functions and its API type is {}.
When your Convex folder isn’t the default convex/, or when you’re using a custom layout (like with fluent-query), you must pass the modules glob into convexTest. [Get started]
Do something like this:
export const modules = import.meta.glob("./**/*.ts");
Then in your test:
import { convexTest } from "convex-test";
import { api } from "./_generated/api";
import schema from "./schema";
import { modules } from "./test.setup";
test("create template", async () => {
const t = convexTest(schema, modules).withIdentity({ name: "User" });
const templateId = await t.mutation(
api.templates.createTemplate,
validTemplate,
);
});
Passing modules is what lets convexTest build the same API surface (api.templates...) that your app sees. [Using convex-test; Get started]
If you’re already passing modules and still get {}, the knowledge sources don’t show a fluent-query‑specific issue; in that case I’m not seeing more details in the docs/threads to explain it.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: