egg-sofa-rpc icon indicating copy to clipboard operation
egg-sofa-rpc copied to clipboard

bug in test app.rpcRequest is not a function

Open 345316222 opened this issue 5 years ago • 0 comments

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);
  });
});

345316222 avatar May 09 '20 13:05 345316222