Skip to content

test: cover websocket plugin behavior#216

Open
Treasure520520 wants to merge 1 commit into
outerbase:mainfrom
Treasure520520:bounty/71-websocket-coverage
Open

test: cover websocket plugin behavior#216
Treasure520520 wants to merge 1 commit into
outerbase:mainfrom
Treasure520520:bounty/71-websocket-coverage

Conversation

@Treasure520520
Copy link
Copy Markdown

/claim #71

Summary

Adds a focused, non-overlapping Vitest coverage slice for the WebSocket plugin.

Covered behavior:

  • default and custom socket route registration
  • non-upgrade requests returning the existing 400 response without opening a socket pair
  • WebSocket upgrade responses returning the client socket and accepting the server socket
  • query messages calling the injected executeQuery operation with context data and sending the serialized result back
  • non-query messages being ignored
  • sendMessage() delegating to the provided client socket

This is test-only and does not change production behavior.

Verification

  • ../starbasedb/node_modules/.bin/vitest run plugins/websocket/index.test.ts --config ../starbasedb/vitest.config.ts
  • ../starbasedb/node_modules/.bin/prettier --check plugins/websocket/index.test.ts
  • git diff --check

Note: this worktree reused the existing installed dependencies from the neighboring checkout because this machine does not have global pnpm available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant