babel-plugin-istanbul-ry
v0.0.5
Published
A babel plugin that adds istanbul instrumentation to ES6 code
Downloads
4
Maintainers
Readme
babel-plugin-ry-istanbul-web
Babel-plugin-ry-isture-web is modified by babel-plugin-istanbul
babel-plugin-ry-istanbul-web是通过babel-plugin-istanbul修改而来
babel-plugin-istanbul documentation can be found here
https://www.npmjs.com/package/babel-plugin-istanbul
babel-plugin-istanbul 文档可参考
http://www.npmdoc.org/babel-plugin-istanbulzhongwenwendangbabel-plugin-istanbul-jszhongwenjiaochengjiexi.html
npm install it:
npm install --save-dev babel-plugin-ry-istanbul
npm安装方法
npm install --save-dev babel-plugin-ry-istanbul
- npm address:https://www.npmjs.com/package/babel-plugin-istanbul-ry
- Gitlab address:https://git.minrow.com/ry/babel-plugin-ry-istanbul
- npm 地址:https://www.npmjs.com/package/babel-plugin-istanbul-ry
- Gitlab 地址:https://git.minrow.com/ry/babel-plugin-ry-istanbul
Increasing the parameter indicates instrmenttation
| parameter | explain | type | An optional value | default | other description | | ------------------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | -------- | ----------------------------------------------| | IS_PITCHING_PILE | Whether in pile | String/Boolean | true (String、Boolean) /false (String、Boolean) | false (Boolean) | false (String, Boolean) true (String) disables instrumentation, true (Boolean) allows it | | INCREMENT | Whether to filter delta files | String/Boolean | true (String、Boolean) /false (String、Boolean) | false (Boolean) | true (String, Boolean) looks at incremental code, false (String) looks at the full code (including incremental code), false (Boolean) looks at the full code, and does not display new or changed statements. | | BRANCH | git diff the branch to compare against | String | The branch name to compare against | origin/master | Don't wear it when the IS PITCHING PILE is false |
增加参数说明instrmenttation
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 其他说明 | | ------------------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | -------- | ---------- | | IS_PITCHING_PILE | 是否插桩 | String/Boolean | true (String、Boolean) /false (String、Boolean) | false(Boolean) | false (String、Boolean) true(String)禁止插桩,true (Boolean)允许插桩 | | INCREMENT | 是否过滤增量文件 | String/Boolean | true (String、Boolean) /false (String、Boolean) | false(Boolean) | true(String、Boolean)看增量代码,false(String)看全量代码(包括增量代码), false(Boolean)看全量代码,不显示“新增或变更语句” | | BRANCH | git diff需要对比的分支 | String | 需要对比的分支名 | origin/master | 当IS_PITCHING_PILE为false的时候可以不穿 |
Increment interpolation
*In the case of vue
, This is done via babel.config.js's plugins configuration, as shown in the following code:
plugins: [
[
'istanbul-ry',
{
extension: ['.js', '.vue'],
instrmenttation: {
BRANCH: 'origin/master',
INCREMENT: 'true',
IS_PITCHING_PILE: true,
IS_HTML_CSS: false
}
}
]
]
It is recommended to comment out the plugins when the code is uploaded or the instrmenttation does not transfer any value
增量插桩
- 以
vue
为例,通过babel.config.js的plugins配置即可完成如下代码所示:
plugins: [
[
'istanbul-ry',
{
extension: ['.js', '.vue'],
instrmenttation: {
BRANCH: 'origin/master',
INCREMENT: 'true',
IS_PITCHING_PILE: true,
IS_HTML_CSS: false
}
}
]
]
上传代码时需要将plugins注释掉即可,也可不传输instrmenttation参数,推荐注释后上传
Description of New Features
- Add the instrmenttation parameter
- IS_PITCHING_PILE determines if code coverage can be instrumentalized
- Use the BRANCH parameter to identify the git branch you want to compare against
- Use INCREMENT to determine if you want to see the incremental code
- IS HTML CSS to determine if vue should look at html and css structure
新增功能说明
- 新增instrmenttation参数
- 通过IS_PITCHING_PILE判断是否可以插装收集代码覆盖率
- 通过BRANCH参数确认需要对比的git分支
- 通过INCREMENT判断是否需要查看增量代码
- 通过IS_HTML_CSS判断vue下是否要看html及css结构
other description
This plugin needs to be used with ry-istanbul-web and istanbul-middleware-ry
其他说明
本插件需配合ry-istanbul-web 与istanbul-middleware-ry一起使用
ry-istanbul-web
NPM address:https://www.npmjs.com/package/ry-istanbul-web
GitLab address:https://git.minrow.com/ry/istanbul-web
NPM地址:https://www.npmjs.com/package/ry-istanbul-web
GitLab地址:https://git.minrow.com/ry/istanbul-web
ry-istok-web is modified from istanbul, adding the changeLists array of window.coverage for viewing the incremental code
ry-istok-web是由istanbul改装而来,增加window.__coverage__的changeLists数组用于查看增量代码
istanbul-middleware-ry
- NPM address:https://www.npmjs.com/package/istanbul-middleware-ry
- GitLab address:https://git.minrow.com/ry/istanbul-middleware-ry
- NPM地址:https://www.npmjs.com/package/istanbul-middleware-ry
- GitLab地址:https://git.minrow.com/ry/istanbul-middleware-ry
- The istanbul-middleware-ry istanbul viewing service is transformed from istanbul-middleware, and the start service is added. The istanbul code coverage can be collected and viewed through the global command
coverage -n
start service. - istanbul-middleware-ry istanbul查看服务由istanbul-middleware改造而来,增加启动服务,可通过全局命令
coverage -n
启动服务收集并查看istanbul代码覆盖率。