CenFun

Results 8 issues of CenFun

### System info - Playwright Version: [^1.41.0] - Operating System: [Windows 10] - Browser: [Chromium] ### Source code Example js, path is: `.temp/my.js` and content: ``` console.log("my js content with...

P3-collecting-feedback

Thanks for the project. Currently, the emptyLineBefore default to always. How to specify emptyLineBefore to never? possible reason: - emptyLineBefore=always conflicts with rule 'declaration-empty-line-before' in [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard/) - I prefer to...

@bcoe This PR is to add [Monocart](https://github.com/cenfun/monocart-coverage-reports) report support for c8. In order to adapt to c8, Monocart has made many adjustments, such as supporting Node 14 and allowing empty...

## 背景 - 上一次介绍JS代码覆盖率已经是9年前了:[代码覆盖率工具 Istanbul 入门教程](https://www.ruanyifeng.com/blog/2015/06/istanbul.html) 基于Istanbul编译插桩的方式来统计JS代码覆盖率,至今仍然是被绝大多数测试工具采用的方案。 - 而早在2017年,V8引擎就开始提供了原生的V8格式覆盖率数据,官方介绍:https://v8.dev/blog/javascript-code-coverage 但却一直没有对应的工具来生成报告 ## Istanbul覆盖率的问题和现状 - 首先就是前端在10年间发生了翻天覆地的变化,诞生了各种新框架,比如vue,jsx,ts,nextjs等全新的源码格式,那么还原覆盖率到不同的源码文件无疑是个挑战,需要精准的Sourcemap支持 - 源码格式多,编译和构建工具也多,老牌webpack+babel,已经新生esbuild,rollup,swc,vite等,每个工具都需要有对应的Istanbul插桩插件,导致同一个文件插桩的数据可能存在一些差异,从而无法正常合并覆盖率,比如unit test和e2e的覆盖率合并,nextjs全栈的(前后端)代码覆盖率合并等。(注:esbuild官方早已放弃支持Istanbul,毕竟插桩严重影响编译性能) - 前端项目越来越大,越来越复杂,插桩本身使得编译变慢,而且文件大小翻倍 - CSS覆盖率并未得到Istanbul的支持 ## V8覆盖率的问题和现状 - [v8-to-istanbul](https://github.com/istanbuljs/v8-to-istanbul/) 是可以转换V8数据到Istanbul格式并生成报告的工具,但此工具仅仅只做了非常简单且模糊的转换,各类指标都不准确,比如lines行覆盖,并未能识别和排除注释行和空行,而statements语句也只是简单的等同于行,branches分支和functions函数更不用说了,大多数情况都不准确 - 然而几乎最流行的测试工具,比如c8,jest,vitest只要是使用v8覆盖率数据的,都是基于v8-to-istanbul进行转换,自然都存在上面的问题 (注:vitest的开发有尝试一些修正,但只是勉强排除了注释行) ##...

weekly

upstream issue: https://github.com/cenfun/monocart-coverage-reports/issues/81 original issue (@edumserrano): https://github.com/cenfun/monocart-reporter/issues/149

- multiple inline sourcemaps (not comments in file end) - multiple eval sourcemaps link - https://github.com/evanw/node-source-map-support - https://github.com/lydell/source-map-resolve

- dateH with timezoneOffset (fixed)