MCPcopy Create free account
hub / github.com/Noumena-Network/code / expectAttachment

Function expectAttachment

src/query/stopHooks.test.ts:69–85  ·  view source on GitHub ↗
(
  events: unknown[],
  attachmentType: string,
  expected: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

67}
68
69function expectAttachment(
70 events: unknown[],
71 attachmentType: string,
72 expected: Record<string, unknown>,
73) {
74 const attachmentMessage = (events as Array<Record<string, unknown>>).find(
75 event =>
76 event.type === 'attachment' &&
77 (event.attachment as { type?: string } | undefined)?.type ===
78 attachmentType,
79 )
80
81 expect(attachmentMessage).toMatchObject({
82 type: 'attachment',
83 attachment: expected,
84 })
85}
86
87function expectUserMessage(events: unknown[], content: string) {
88 const userMessage = (events as Array<Record<string, unknown>>).find(

Callers 1

stopHooks.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected