Registry / testing / wishmock

wishmock

JSON →
library0.9.9jsnpmunverified

Wishmock is a gRPC and Connect RPC mock server (v0.9.9, released monthly) with hot reload, rule-based responses, built-in protovalidate support, and native gRPC-Web without a proxy. It runs as a global CLI, auto-creates project structure, and features a Web UI, Admin API, and MCP server for AI integration. Compared to alternatives like grpc-mock, it offers Connect RPC support and TLS/mTLS out of the box.

npm install wishmock
INSTALL
IMPORT
SIG · WISHMOCK
W
wishmock
testingjavascriptv0.9.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wishmock CLI
✓ npm install -g wishmock
✗ yarn global add wishmock
Installed globally as a CLI tool. Not imported as a library.
wishmock (programmatic use)
✓ import { startServer } from 'wishmock'
✗ const wishmock = require('wishmock')
The package exports a startServer function for programmatic use. CJS require may still work but ESM is preferred.
wishmock MCP server
✓ npx wishmock-mcp
Separate entrypoint for MCP server, started via CLI or programmatically.

Install Wishmock globally, create a project directory, start the server, and test with grpcurl or the Admin API.

// Install globally npm install -g wishmock // Initialize project mkdir my-grpc-mock && cd my-grpc-mock // Start server (auto-creates directories) wishmock // In another terminal, test with grpcurl: grpcurl -plaintext localhost:50050 list grpcurl -plaintext -d '{"name":"World"}' localhost:50050 hello.Greeter/SayHello // Or use the Admin API: curl http://localhost:4319/admin/status
Debug
Known issues
gotchaWhen using dot notation in rule keys (e.g., user.age), the key must be quoted in YAML when it contains dots in the match block.
fix
Use match.request["user.age"] instead of match.request.user.age (though some parsers may accept both).
affects: >=0.0.0
breakingDefault ports changed between versions: In v0.9.x, the Connect RPC default port is 50052 and gRPC default is 50050. Earlier versions may have used different defaults.
fix
Set environment variables GRPC_PORT_PLAINTEXT=50050 and CONNECT_PORT=50052 explicitly if upgrading from an older version.
affects: <0.9.0
deprecatedThe environment variable GRPC_PORT is deprecated; use GRPC_PORT_PLAINTEXT for plaintext connections.
fix
Rename GRPC_PORT to GRPC_PORT_PLAINTEXT in your configuration.
affects: >=0.8.0
gotchaWithout any rule file, the server returns an empty object {} with status OK, which may not match the expected proto response shape.
fix
Always create a rule file (e.g., rules/grpc/hello.greeter.sayhello.yaml) defining the response body.
affects: >=0.0.0
gotchaThe server requires Node.js >=18 due to ESM features. Using an older version will cause syntax errors.
fix
Upgrade Node.js to version 18 or later.
affects: >=0.9.0
Errors
Common errors & fixes
wishmock: command not found
Wishmock not installed globally or not in PATH.
fix
Run 'npm install -g wishmock' and ensure npm global bin directory is in your PATH.
Error: Cannot find module 'wishmock'
Trying to import wishmock as a local module instead of using the CLI.
fix
Install wishmock globally or use 'npx wishmock' for one-off execution.
Error: listen EADDRINUSE :::50050
Default gRPC port 50050 is already in use by another process.
fix
Set GRPC_PORT_PLAINTEXT to an available port, e.g., 'GRPC_PORT_PLAINTEXT=50051 wishmock'.
TypeError: Cannot read properties of undefined (reading 'name')
A rule file references a request field that does not exist in the proto definition.
fix
Check the proto definition and ensure the rule matches the correct field names.
SyntaxError: Unexpected token '.'
Using YAML dot notation incorrectly in rule files (e.g., match.request.user.age instead of match.request["user.age"]).
fix
Quote keys with dots in the match block: match.request["user.age"].
Upgrade
Version history
0.9.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
18
Resources
wishmock — npm install wishmock · libregistry