New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style(progressive):upgrade to egg2.x #49
Conversation
SunShinewyf
commented
Dec 8, 2017
- 书写风格升级到Egg2.x
- 修改了一下readme
- 更新了一些依赖
.travis.yml
Outdated
@@ -2,11 +2,7 @@ sudo: false | |||
language: node_js | |||
node_js: | |||
- '8' | |||
services: | |||
- postgresql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件之前咋有这个的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啊,不知道咋出来的,我看看
progressive/step1/test/index.test.js
Outdated
@@ -1,18 +1,18 @@ | |||
'use strict'; | |||
|
|||
|
|||
const mm = require('egg-mock'); | |||
const { mock } = require('egg-mock/bootstrap') | |||
|
|||
describe('test/index.test.js', () => { | |||
let app; | |||
|
|||
before(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要 before after 等了,直接从 bootstrap 里面拿到 app 即可
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以看下最新的骨架
progressive/step2/app/router.js
Outdated
@@ -1,5 +1,6 @@ | |||
'use strict'; | |||
|
|||
module.exports = app => { | |||
app.router.get('/', app.controller.home.isIOS); | |||
const {router,controller} = app; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逗号后面少个空格,是不是 eslintignore 里面忽略了?把 fixture 干掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是eslint的原因,没控制好代码格式,“把fixture干掉”是什么意思,删掉fixture这个目录?
去掉 .eslintignore 中 test/fixture 那一行,重新跑 lint
发自我的 iPhone
… 在 2017年12月9日,09:55,恬竹 ***@***.***> 写道:
@SunShinewyf commented on this pull request.
In progressive/step2/app/router.js:
> @@ -1,5 +1,6 @@
'use strict';
module.exports = app => {
- app.router.get('/', app.controller.home.isIOS);
+ const {router,controller} = app;
这个是eslint的原因,没控制好代码格式,“把fixture干掉”是什么意思,删掉fixture这个目录?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其他 +1
progressive/step1/test/index.test.js
Outdated
return app.ready(); | ||
}); | ||
|
||
after(() => app.close()); | ||
afterEach(mock.restore); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afterEach 也是不需要的,可以看看 bootstrap 里面做了啥
.travis.yml
Outdated
@@ -3,10 +3,10 @@ language: node_js | |||
node_js: | |||
- '8' | |||
services: | |||
- postgresql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要缩进的吧,这文件直接回滚不修改就好了
|
||
describe('test/framework.test.js', () => { | ||
let app; | ||
|
||
before(() => { | ||
app = mm.app({ | ||
app = mock.app({ | ||
baseDir: 'test-app', | ||
customEgg: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
customEgg 改为 framework
ci 挂了,少了 config.keys |
progressive/step1/package.json
Outdated
@@ -7,11 +7,14 @@ | |||
}, | |||
"devDependencies": { | |||
"egg-bin": "^4.3.5", | |||
"egg-mock": "^3.13.1" | |||
"egg-mock": "^3.13.1", | |||
"autod": "^3.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
人肉加的?这里其实不用 autod,都在外面执行的。
progressive/step1/package.json
Outdated
@@ -3,7 +3,7 @@ | |||
"version": "1.0.0", | |||
"private": true, | |||
"dependencies": { | |||
"egg": "^1.10.1" | |||
"egg": "^2.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多了个空格