MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createThread

Function createThread

apps/web/src/lib/bot/platforms/linear.test.ts:121–145  ·  view source on GitHub ↗
(
  post: PostSpy = jest.fn<Promise<void>, [{ markdown: string }]>(async () => undefined),
  overrides: { threadMessages?: Message[]; id?: string } = {}
)

Source from the content-addressed store, hash-verified

119}
120
121function createThread(
122 post: PostSpy = jest.fn<Promise<void>, [{ markdown: string }]>(async () => undefined),
123 overrides: { threadMessages?: Message[]; id?: string } = {}
124): Thread {
125 const id = overrides.id ?? 'linear:iss-1';
126 return {
127 id,
128 adapter: { name: 'linear' },
129 isDM: false,
130 channel: {
131 fetchMetadata: async () => null,
132 },
133 get messages() {
134 return asAsyncIterable(overrides.threadMessages ?? []);
135 },
136 post,
137 toJSON: () => ({
138 _type: 'chat:Thread',
139 adapterName: 'linear',
140 channelId: id,
141 id,
142 isDM: false,
143 }),
144 } as unknown as Thread;
145}
146
147function createPlatformIntegration(
148 overrides: Partial<PlatformIntegration> = {}

Callers 1

linear.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected