egg-sofa-rpc
egg-sofa-rpc copied to clipboard
bug in test app.rpcRequest is not a function
should invoke ProtoService: TypeError: app.rpcRequest is not a function
import mm from 'egg-mock';
describe('test/app/rpc/ProtoService.test.ts', () => {
let app;
before(async function() {
app = mm.app({
baseDir: 'app/rpcserver',
});
await app.ready();
});
after(async () => {
await app.close();
});
it('should invoke ProtoService', done => {
app.rpcRequest('com.nodejs.rpc.ProtoService')
.invoke('echoObj')
.send({ name: 'test', group: 'A' })
.expect({ code: 200, message: 'hello test, you are in 0' }, done);
});
});