index.test.ts 402 B

1234567891011
  1. import { createLightApp } from '@midwayjs/mock';
  2. import * as custom from '../src';
  3. describe('/test/index.test.ts', () => {
  4. it('test component', async () => {
  5. const app = await createLightApp('', {
  6. imports: [custom],
  7. });
  8. const bookService = await app.getApplicationContext().getAsync(custom.BookService);
  9. expect(await bookService.getBookById()).toEqual('hello world');
  10. });
  11. });