0.1.8 • Published 2 years ago

islin v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Islin Logo

一个多端、多版本、实时的前端代码覆盖率收集平台

NPM Version NPM Downloads

Islin.reportCoverage({
    dsn: 'http://xxx.xxx/api/v1/coverage/client',
    projectConfig: {
        projectName: 'projectName',
        commitSha: 'commitSha',
        projectId: 999,
        coverage: window.__coverage__
    },
    reporter:'reporter'
})

✨特性

  • 🌈 支持多端,H5、小程序、RN。
  • ⚙️ 支持多版本覆盖率收集。
  • ⏰ 实时生成代码覆盖率报告。
  • 📦 开箱即用,只需要配置项目的基本信息即可。

comment: <> (- ⛵️ 支持自托管 Islin。)

📦 快速开始

代码插桩

babel-plugin-istanbul安装

npm install --save-dev babel-plugin-istanbul

这段代码表示env为test时istanbul插件生效:

{
  "env": {
    "test": {
      "plugins": [
        "istanbul"
      ]
    }
  }
}

具体请阅读 babel-plugin-istanbul 文档

覆盖率上报

根据需要选择 islin 安装位置

npm install --save-dev islin

在UI自动化case编写上报代码

// 需要在每个页面case结束时,获取当前页面的window.__coverage__对象,将覆盖率上报。
Islin.reportCoverage({
    dsn: 'http://xxx.xxx/api/v1/coverage/client',
    projectConfig: {
        projectName: 'projectName',
        commitSha: 'commitSha',
        projectId: 999,
        coverage: window.__coverage__,
    },
    reporter:'reporter',
})

亦可手工测试(提供 islin-crx Chrome扩展)

comment: <> (## 自托管)

comment: <> (提供基于docker的islin自托管方案)

License

MIT

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago