Skip to content

Commit d870c19

Browse files
Add type coverage for custom run store options
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent a4bab4c commit d870c19

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/ai/src/chatTransport.types.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { InferUIMessageChunk, UIMessage } from "ai";
33
import {
44
createTriggerChatTransport,
55
TriggerChatTransport,
6+
InMemoryTriggerChatRunStore,
67
TriggerChatTransportOptions,
78
type TriggerChatOnError,
89
type TriggerChatTransportError,
@@ -176,3 +177,14 @@ it("accepts tuple-style headers in sendMessages options", function () {
176177
expectTypeOf(transport.sendMessages).toBeFunction();
177178
void tupleHeaders;
178179
});
180+
181+
it("accepts custom run store implementations via options typing", function () {
182+
const runStore = new InMemoryTriggerChatRunStore();
183+
const transport = new TriggerChatTransport({
184+
task: "ai-chat",
185+
accessToken: "pk_test",
186+
runStore,
187+
});
188+
189+
expectTypeOf(transport).toBeObject();
190+
});

0 commit comments

Comments
 (0)