-
- Notifications
You must be signed in to change notification settings - Fork 1.8k
test: add async test case #339
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
Conversation
| 从代码到测试都可以用 aa |
9a88474 to b275040 Compare | "extends": "eslint-config-egg" | ||
| "extends": "eslint-config-egg", | ||
| "parserOptions": { | ||
| "ecmaVersion": 2017 |
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-config-egg 里面去了?
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.
放到 test/fixtures/apps/async-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.
@geekdada 看看?
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.
在 test/async/_async.js 里面也有用,感觉还是把它放到 eslint-config-egg 里面吧,不然别人用 node 7 + async 就比较麻烦了。
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.
@geekdada 会和现在的配置冲突么?如果不冲突的话是不是可以合并成一个。
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.
@dead-horse 现行代码的运行环境非 2017,如果默认使用 2017 就没有意义了吧。
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.
那看起来是可以的,以后很多会用 async function 的
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.
@geekdada 但是会有人基于 node 7.x 开发,要用 async function
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.
@dead-horse 我在那边新建一个 pr 大家看一下
b275040 to b72c52c Compare | | ||
| const nodeVersion = Number(process.version.match(/^v(\d+\.\d)+\./)[1]); | ||
| // only node >= 7.6 support async function without flags | ||
| if (nodeVersion >= 7.6) { |
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.
这样 require 进来就没问题了
| schedule 也加个? |
Codecov Report@@ Coverage Diff @@ ## master #339 +/- ## ===================================== Coverage 100% 100% ===================================== Files 28 28 Lines 635 635 ===================================== Hits 635 635Continue to review full report at Codecov.
|
Codecov Report@@ Coverage Diff @@ ## master #339 +/- ## ===================================== Coverage 100% 100% ===================================== Files 28 28 Lines 635 635 ===================================== Hits 635 635Continue to review full report at Codecov.
|
b72c52c to 0a91397 Compare | schedule 加了 |
0a91397 to fb7247d Compare
Checklist
npm testpassesAffected core subsystem(s)
test
Description of change
增加 async 相关的测试用例,需要等 egg-core 发布新版和 node 7.6 发布。