MCPcopy
hub / github.com/TanStack/ai / dispatchToolFixture

Function dispatchToolFixture

packages/ai-client/tests/devtools.test.ts:170–185  ·  view source on GitHub ↗
(overrides: Partial<AIDevtoolsToolFixture> = {})

Source from the content-addressed store, hash-verified

168 }
169
170 function dispatchToolFixture(overrides: Partial<AIDevtoolsToolFixture> = {}) {
171 const fixture: AIDevtoolsToolFixture = {
172 hookId: 'chat-1',
173 threadId: 'thread-1',
174 runId: 'run-fixture',
175 toolName: 'weather',
176 input: { city: 'Paris' },
177 output: { temperature: 21 },
178 toolCallId: 'fixture-call',
179 messageId: 'fixture-message',
180 ...overrides,
181 }
182
183 eventClientMock.dispatch('devtools:tool-fixture:apply', fixture)
184 return fixture
185 }
186
187 function latestSnapshotMessages(): Array<UIMessage> {
188 const latestSnapshot = eventClientMock

Callers 1

devtools.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected