Test.test.ts 366 B

12345678910111213141516
  1. import * as assert from 'assert';
  2. import { Context } from 'egg';
  3. import { app } from 'egg-mock/bootstrap';
  4. describe('test/app/service/Test.test.js', () => {
  5. let ctx: Context;
  6. before(async () => {
  7. ctx = app.mockContext();
  8. });
  9. it('sayHi', async () => {
  10. const result = await ctx.service.test.sayHi('egg');
  11. assert(result === 'hi, egg');
  12. });
  13. });