ruvnet/ruflo · error

WebSocket mocking not yet implemented

Error message

WebSocket mocking not yet implemented

What it means

Placeholder in the testing setup helper's mockWebSocket(): WebSocket mocking is not implemented, so calling it only logs and does nothing — tests relying on it get no interception. HTTP fetch mocking above it is functional.

Source

Thrown at v3/@claude-flow/testing/src/helpers/setup-teardown.ts:484

            throw new Error(`No mock found for ${method} ${url}`);
          }

          if (match.delay) {
            await new Promise(resolve => setTimeout(resolve, match.delay));
          }

          return new Response(JSON.stringify(match.body), {
            status: match.status ?? 200,
            headers: match.headers ?? { 'Content-Type': 'application/json' },
          });
        });
      }
    },

    mockWebSocket(handler: (message: unknown) => unknown): void {
      // WebSocket mocking would require more setup
      // This is a placeholder for the interface
      console.warn('WebSocket mocking not yet implemented');
    },

    clearMocks(): void {
      fetchResponses.length = 0;
      if (originalFetch) {
        global.fetch = originalFetch;
      }
    },
  };
}

/**
 * File system test helper
 */
export interface FileSystemTestHelper {
  createTempDir(): Promise<string>;
  createFile(path: string, content: string): Promise<void>;
  readFile(path: string): Promise<string>;

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Implement the WebSocket mock in setup-teardown.ts (e.g. using a mock-socket style fake) or mark the test as skipped until supported.
  2. Use a real loopback WebSocket server in tests instead of mocking.
  3. Guard tests requiring WebSocket mocking so they fail with a clear skip reason rather than this error.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Test setup requests a mocked WebSocket transport before the mock implementation exists; any test calling setupTeardown with transport 'websocket' hits this unimplemented branch.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/44170a88cd8ca0bb. Report an issue: GitHub.