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

Function mountStructuredHost

packages/ai-angular/tests/inject-chat.test.ts:127–140  ·  view source on GitHub ↗
(schema: z.ZodTypeAny)

Source from the content-addressed store, hash-verified

125 // the schema-gated `partial` / `final` signals are present on the result.
126 // The shared renderInjectChat harness erases the schema type.
127 function mountStructuredHost(schema: z.ZodTypeAny) {
128 const adapter = createMockConnectionAdapter()
129
130 @Component({ standalone: true, template: '' })
131 class StructuredHost {
132 chat = injectChat({ connection: adapter, outputSchema: schema })
133 }
134 const fixture = TestBed.createComponent(StructuredHost)
135 fixture.detectChanges()
136 return {
137 result: fixture.componentInstance.chat,
138 flush: () => fixture.detectChanges(),
139 }
140 }
141
142 it('partial → final transition via setMessages', () => {
143 const schema = z.object({ title: z.string() })

Callers 1

Calls 1

Tested by

no test coverage detected