Neurologically Paralyzing Mouseovers
Miss any of our Open RFC calls?Watch the recordings here! »

grpc-mock-server

1.1.6 • Public • Published

grpc-mock-server

gRPC mock server for tests with typescript definitions.

NPM CI

Usage example:

private static readonly PROTO_PATHstring = __dirname + "example.proto";
private static readonly PKG_NAMEstring = "com.alenon.example";
private static readonly SERVICE_NAMEstring = "ExampleService";
 
...
    
const implementations = {
    ex1: (call: any, callback: any) => {
        const response: any =
            new this.proto.ExampleResponse.constructor({msg: "the response message"});
        callback(null, response);
    },
};
 
this.server.addService(PROTO_PATH, PKG_NAME, SERVICE_NAME, implementations);
this.server.start();

Install

npm i grpc-mock-server

DownloadsWeekly Downloads

2

Version

1.1.6

License

MIT

Unpacked Size

2.93 kB

Total Files

3

Last publish

Collaborators

  • avatar