UNPKG

generator-eggjs

Version:
24 lines (19 loc) 422 B
'use strict'; const mock = require('egg-mock'); describe('test/<%- name %>.test.js', () => { let app; before(() => { app = mock.app({ baseDir: 'apps/<%- name %>-test', }); return app.ready(); }); after(() => app.close()); afterEach(mock.restore); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, <%- pluginName %>') .expect(200); }); });