Registry / testing / yas-grpc

yas-grpc

JSON →
library1.1.6jsnpmunverified

Extends yaml-scene to support gRPC calls, mock servers, and documentation generation. Current version 1.1.6 (2024). Designed for testing and mocking gRPC services using YAML-based scenarios. Key differentiator: integrates tightly with yaml-scene ecosystem, enabling full gRPC lifecycle management (call, mock, document) without writing code, via simple YAML definitions. Alternatives like grpc-mock or protobuf-test require programmatic setup.

npm install yas-grpc
INSTALL
IMPORT
SIG · YAS-GRPC
Y
yas-grpc
testingjavascriptv1.1.6
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.

yas-grpc
Add via `yas add yas-grpc` or `npm install -g yas-grpc`
import yas-grpc directly in code
This is a schema extension for yaml-scene, not a library to import programmatically. Use in YAML files.

Shows how to install yas-grpc and use it to make a gRPC call in a yaml-scene scenario.

# Install yaml-scene and extension yas init && yas add yas-grpc # Make a gRPC call # scenario.yaml: - yas-grpc/Call: proto: ./proto/user.proto package: user service: UserService method: GetUser address: localhost:50051 request: id: 1 # Start mock gRPC server yas run -s scenario.yaml
Debug
Known issues
gotchaproto paths must be relative to the YAML scenario file, not the current working directory
fix
Use absolute paths or paths relative to the scenario file using __dirname or join.
affects: >=1.0.0
deprecatedIn yas-grpc/Doc/MD, the `signature` field is deprecated and may be removed in v2.
fix
Omit `signature` or use `author` instead.
affects: >=1.1.0
breakingVersion 1.0.0 changed YAML syntax from `grpc/Call` to `yas-grpc/Call`. Older scenarios break.
fix
Update all YAML step keys to use `yas-grpc/` prefix.
affects: <1.0.0
Errors
Common errors & fixes
Error: Cannot find module './proto/server.proto'
Proto file path is relative to the yaml-scene process, not the YAML file.
fix
Use an absolute path or construct path with __dirname: `${__dirname}/proto/server.proto`.
yaml-scene: unknown step type: yas-grpc/Call
yas-grpc extension not installed or yaml-scene not available.
fix
Install yaml-scene and yas-grpc globally: `npm install -g yaml-scene yas-grpc`.
TypeError: Cannot read properties of undefined (reading 'request')
In custom handler, `this.request` is undefined if the request is not provided.
fix
Ensure the step has a `request` field, or check for undefined in your handler.
Upgrade
Version history
1.1.6latest on npm
Audit
Dependencies
yaml-scenerequiredRuntime platform; yas-grpc is an extension and cannot run standalone
Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
1
Resources
yas-grpc — npm install yas-grpc · libregistry