We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d596657 commit 035a9aaCopy full SHA for 035a9aa
template-component/src/test.ts
@@ -1,3 +1,17 @@
1
+import type { TestConvex } from "convex-test";
2
+import type { GenericSchema, SchemaDefinition } from "convex/server";
3
import schema from "./component/schema.js";
4
const modules = import.meta.glob("./component/**/*.ts");
-export default { schema, modules };
5
+
6
+/**
7
+ * Register the component with the test convex instance.
8
+ * @param t - The test convex instance, e.g. from calling `convexTest`.
9
+ * @param name - The name of the component, as registered in convex.config.ts.
10
+ */
11
+function register(
12
+ t: TestConvex<SchemaDefinition<GenericSchema, boolean>>,
13
+ name: string = "shardedCounter"
14
+) {
15
+ t.registerComponent(name, schema, modules);
16
+}
17
+export default { register, schema, modules };
0 commit comments