egg-boilerplate-simple
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -7,7 +7,7 @@ { | ||
"dependencies": { | ||
"egg": "^0.7.0" | ||
"egg": "^0.9.0" | ||
}, | ||
"devDependencies": { | ||
"autod": "^2.7.1", | ||
"egg-bin": "^1.10.0", | ||
"egg-bin": "^2.0.2", | ||
"egg-ci": "^1.1.0", | ||
@@ -17,3 +17,2 @@ "egg-mock": "^2.1.0", | ||
"eslint-config-egg": "^3.2.0", | ||
"cheerio": "^0.22.0", | ||
"supertest": "^2.0.1", | ||
@@ -20,0 +19,0 @@ "webstorm-disable-index": "^1.1.2" |
'use strict'; | ||
module.exports = function* home() { | ||
exports.index = function* index() { | ||
this.body = 'hi, egg'; | ||
}; |
'use strict'; | ||
module.exports = app => { | ||
app.get('/', 'home'); | ||
app.get('/', 'home.index'); | ||
}; |
'use strict'; | ||
const request = require('supertest'); | ||
const mm = require('egg-mock'); | ||
describe('test/app/controller/home.test.js', () => { | ||
let app; | ||
before(() => { | ||
app = mm.app(); | ||
return app.ready(); | ||
it('should app auto init on setup.js', () => { | ||
// app is auto init at `test/.setup.js` | ||
assert(app); | ||
assert(mock); | ||
// mock alias | ||
assert(mm); | ||
assert(request); | ||
}); | ||
after(() => app.close()); | ||
afterEach(mm.restore); | ||
it('should GET /', () => { | ||
return request(app.callback()) | ||
.get('/') | ||
.expect('hi, egg') | ||
.expect(200); | ||
.get('/') | ||
.expect('hi, egg') | ||
.expect(200); | ||
}); | ||
}); |
2.1.0 / 2017-01-25 | ||
================== | ||
* feat: auto add .setup.js (#20) | ||
2.0.1 / 2017-01-16 | ||
@@ -3,0 +8,0 @@ ================== |
{ | ||
"name": "egg-boilerplate-simple", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "boilerplate for egg quickstart", | ||
@@ -12,3 +12,4 @@ "scripts": { | ||
"ci-boilerplate": "npm run build && npm run install-deps && cd dist && npm run ci", | ||
"build": "egg-init dist --force --silent --template=./", | ||
"clean": "rm -rf boilerplate/.idea boilerplate/logs boilerplate/node_modules boilerplate/run", | ||
"build": "npm run clean && egg-init dist --force --silent --template=./", | ||
"install-deps": "cd dist && ../node_modules/.bin/autod && ../node_modules/.bin/npminstall" | ||
@@ -30,5 +31,5 @@ }, | ||
"egg-init": "^1.6.1", | ||
"eslint": "^3.13.1", | ||
"eslint": "^3.14.0", | ||
"eslint-config-egg": "^3.2.0", | ||
"npminstall": "^2.16.0", | ||
"npminstall": "^2.16.1", | ||
"webstorm-disable-index": "^1.1.2" | ||
@@ -35,0 +36,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
11467
26
89