MCPcopy
hub / github.com/simstudioai/sim / expectBlockExists

Function expectBlockExists

packages/testing/src/assertions/workflow.assertions.ts:15–27  ·  view source on GitHub ↗
(
  blocks: Record<string, any>,
  blockId: string,
  expectedType?: string
)

Source from the content-addressed store, hash-verified

13 * ```
14 */
15export function expectBlockExists(
16 blocks: Record<string, any>,
17 blockId: string,
18 expectedType?: string
19): void {
20 expect(blocks[blockId], `Block "${blockId}" should exist`).toBeDefined()
21 expect(blocks[blockId].id).toBe(blockId)
22 if (expectedType) {
23 expect(blocks[blockId].type, `Block "${blockId}" should be type "${expectedType}"`).toBe(
24 expectedType
25 )
26 }
27}
28
29/**
30 * Asserts that a block does NOT exist in the workflow.

Callers 1

store.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected