/// import type { TestConvex } from "convex-test"; import type { GenericSchema, SchemaDefinition } from "convex/server"; import type { ComponentApi } from "./component/_generated/component.js"; import schema from "./component/schema.js"; const modules = import.meta.glob("./component/**/*.ts"); /** * Register the component with the test convex instance. * @param t - The test convex instance, e.g. from calling `convexTest`. * @param name - The name of the component, as registered in convex.config.ts. * @returns a component api to test via ctx.runMutation or for thick client * usage. Also provides types for convex-test's defineTestApp. */ export function register( t: TestConvex>, name: string = "persistentTextStreaming", ) { return t.registerComponent(name, schema, modules) as unknown as ComponentApi; } export default { register, schema, modules };