Skip to content

Commit

Permalink
fix: add application test
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore committed Jan 16, 2017
1 parent 649c3a5 commit 5aa491a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
7 changes: 5 additions & 2 deletions framework/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "framework-example",
"version": "1.0.0",
"devDependencies": {
"egg-bin": "^1.0.0"
"egg-bin": "^2.0.0",
"egg-mock": "^2.0.0",
"supertest": "^2.0.1"
},
"scripts": {
"dev": "egg-bin dev"
"dev": "egg-bin dev",
"test": "egg-bin test"
},
"egg": {
"framework": "yadan"
Expand Down
20 changes: 20 additions & 0 deletions framework/app/test/app/controller/home.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

const mock = require('egg-mock');
const request = require('supertest');

describe('test/app/controller/home.test.js', () => {

let app;
before(() => {
app = mock.app();
return app.ready();
});

it('should GET /', () => {
return request(app.callback())
.get('/')
.expect(200)
.expect('hi, framework-example_123456');
});
});
2 changes: 1 addition & 1 deletion framework/yadan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"egg-view-nunjucks": "1.0.0"
},
"devDependencies": {
"egg-bin": "^1.10.0",
"egg-bin": "^2.0.0",
"egg-mock": "^2.0.0",
"supertest": "^2.0.1"
},
Expand Down

0 comments on commit 5aa491a

Please sign in to comment.