describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/middleware/robot.test.js', () => { it('should block robot', () => { return app.httpRequest() .get('/') .set('User-Agent', 'Baiduspider') .expect(403); }); });
// https://mochajs.org/#usage describe('test/app/controller/demo.test.ts', () => { it('should GET /api/demo testEnv', async () => { const result = await app.httpRequest().get('/api/demo').expect(200); assert(result.text === `<h1>${app.env}</h1>`); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', () => { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect(200) }); });
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
// https://mochajs.org/#usage describe('test/app/controller/demo.test.ts', () => { it('should GET /api/demo testEnv', async () => { const result = await app.httpRequest().get('/api/demo').expect(200); assert(result.text === `<h1>${app.env}</h1>`); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', async function() { const pkg = require('../../../package.json') assert(app.config.keys.startsWith(pkg.name)) // const ctx = app.mockContext({}); // await ctx.service.xx(); }) it('should GET /', () => { return app .httpRequest() .get('/') .expect('hi, egg') .expect(200) }) })
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', () => { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', function* () { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });
describe('test/app/controller/home.test.js', () => { it('should assert', () => { const pkg = require('../../../package.json'); assert(app.config.keys.startsWith(pkg.name)); // const ctx = app.mockContext({}); // yield ctx.service.xx(); }); it('should GET /', () => { return app.httpRequest() .get('/') .expect('hi, egg') .expect(200); }); });