最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a way to generate text coverage report for a single test file using Vitest & v8? - Stack Overflow

programmeradmin0浏览0评论

I have an npm script in the package.json:

"test:coverage": "vitest run --coverage",

Also, there is a hello.test.ts test file.

I want:

  1. Vitest to run a single hello.test.ts file
  2. Generate a v8 coverage report for the single corresponding hello.ts file

Unfortunately, I couldn't find anything suitable in the official documentation: /config/#coverage

I tried adding an argument --collectCoverageFrom=src/hello.ts, but it was not recognized.

Running npm run test:coverage hello.test.ts narrows the execution of tests to a hello.test.ts file, but the text coverage report includes other files directly not related to hello.ts.

发布评论

评论列表(0)

  1. 暂无评论