[ViteJS] Empty coverage for all files not covered by tests
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, typescript, vite
- 領域
- frontend, testing-qa
調査の方向性
Cypress の dev-server 設定、vite.config.js、およびレポートに示されている @cypress/code-coverage のサポートとタスクのセットアップから始めます。vite-plugin-istanbul を使って NYC の all 設定の場合を再現し、その後、空のファイルがどのようにカバレッジレポートに変換されるかを追跡します。未テストのファイルが instrumented な行データを保持し、最終的なカバレッジ計算に含まれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Versions
- What is this plugin's version? 3.9.12
- What is Cypress version? 9.1.0
- What is your operating system? MacOS
- How do you instrument your application? Instanbul
- Is there
.nyc_outputfolder? Yes, not empty - Do you have any custom NYC settings? Yes,
all - Do you run Cypress tests in a Docker container? No
Describe the bug
Despite using the all setting of NYC, it seems like only files touched by tests have their line numbers included in the report.
The other files are present but show 0 lines thus are ignored in the final computation of the code coverage.
Using the debug flag, I see them added:
code-coverage adding empty coverage for file /Users/Sytten/Projects/*****/src/main.ts +0ms
code-coverage adding empty coverage for file /Users/Sytten/Projects/*****/src/composables/index.ts +0ms
code-coverage adding empty coverage for file /Users/Sytten/Projects/*****/src/composables/useId.ts +0ms
code-coverage adding empty coverage for file /Users/Sytten/Projects/*****src/composables/useName.ts +0ms
But I would expect them to get line numbers at some point. But they only get:
TN:
SF:src/main.ts
FNF:0
FNH:0
LF:0
LH:0
BRF:0
BRH:0
end_of_record
I use ViteJS and my plugins looks like:
const path = require("path");
const { startDevServer } = require("@cypress/vite-dev-server");
const codeCoverageTask = require("@cypress/code-coverage/task");
const istanbul = require("vite-plugin-istanbul");
module.exports = (on, config) => {
on("dev-server:start", (options) =>
startDevServer({
options,
viteConfig: {
logLevel: "warn",
configFile: path.resolve(__dirname, "..", "..", "vite.config.js"),
plugins: [istanbul({})],
},
})
);
codeCoverageTask(on, config);
return config;
};
Support contains:
// Import commands.js using ES2015 syntax:
import "./commands";
// Alternatively you can use CommonJS syntax:
// require('./commands')
import "@cypress/code-coverage/support";
The coverage for files under test works fine.
Link to the repo
This is not an open-source project, but happy to provide a reproduction if that can help debug it.
- 主要言語
- TypeScript
- スター
- 440
- フォーク
- 114
- 平均マージ
- 42分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cypress-io/code-coverage のほかの issue
-
難易度 3/5 半日 初心者へのやさしさ 40/100
cypress-io/code-coverage#1018 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cypress-io/code-coverage#993 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cypress-io/code-coverage#967 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cypress-io/code-coverage#959 ·
メンテナーはふだん 1 日以内に返信
-
performance
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
cypress-io/code-coverage#933 ·
メンテナーはふだん 1 日以内に返信
cypress-io/code-coverage の issue をすべて見る
似ている issue
-
bug needs-triage potential-regression
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aws/aws-sdk-js-v3#8408 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
colinhacks/zod#6743 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Packing list: the weight field drops digits on a slow connection and saves the wrong weightオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
openai/openai-node#3124 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
anthropics/anthropic-sdk-typescript#1296 ·
メンテナーはふだん 8 日以内に返信