0.0.5 • Published 2 years ago

babel-plugin-istanbul-ry v0.0.5

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
2 years ago

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

Increasing the parameter indicates instrmenttation

parameterexplaintypeAn optional valuedefaultother description
IS_PITCHING_PILEWhether in pileString/Booleantrue (String、Boolean) /false (String、Boolean)false (Boolean)false (String, Boolean) true (String) disables instrumentation, true (Boolean) allows it
INCREMENTWhether to filter delta filesString/Booleantrue (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.
BRANCHgit diff the branch to compare againstStringThe branch name to compare againstorigin/masterDon't wear it when the IS PITCHING PILE is false

增加参数说明instrmenttation

参数说明类型可选值默认值其他说明
IS_PITCHING_PILE是否插桩String/Booleantrue (String、Boolean) /false (String、Boolean)false(Boolean)false (String、Boolean) true(String)禁止插桩,true (Boolean)允许插桩
INCREMENT是否过滤增量文件String/Booleantrue (String、Boolean) /false (String、Boolean)false(Boolean)true(String、Boolean)看增量代码,false(String)看全量代码(包括增量代码), false(Boolean)看全量代码,不显示“新增或变更语句”
BRANCHgit 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
  1. IS_PITCHING_PILE determines if code coverage can be instrumentalized
  2. Use the BRANCH parameter to identify the git branch you want to compare against
  3. Use INCREMENT to determine if you want to see the incremental code
  4. IS HTML CSS to determine if vue should look at html and css structure

新增功能说明

  • 新增instrmenttation参数
  1. 通过IS_PITCHING_PILE判断是否可以插装收集代码覆盖率
  2. 通过BRANCH参数确认需要对比的git分支
  3. 通过INCREMENT判断是否需要查看增量代码
  4. 通过IS_HTML_CSS判断vue下是否要看html及css结构

other description

This plugin needs to be used with ry-istanbul-web and istanbul-middleware-ry

其他说明

本插件需配合ry-istanbul-webistanbul-middleware-ry一起使用

ry-istanbul-web

istanbul-middleware-ry