[ViteJS] Empty coverage for all files not covered by tests
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript, vite
- Lĩnh vực
- frontend, testing-qa
Hướng nghiên cứu
Bắt đầu với cấu hình dev-server của Cypress, vite.config.js và thiết lập support và task của @cypress/code-coverage được nêu trong báo cáo. Tái hiện trường hợp cài đặt all của NYC với vite-plugin-istanbul, sau đó theo dõi cách các tệp rỗng được chuyển thành báo cáo coverage. Hoàn tất nghĩa là các tệp chưa được kiểm thử vẫn giữ dữ liệu dòng đã instrument và được đưa vào phép tính coverage cuối cùng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 440
- Fork
- 114
- Merge trung bình
- 42 phút
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cypress-io/code-coverage
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 40/100
cypress-io/code-coverage#1018 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
cypress-io/code-coverage#993 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
cypress-io/code-coverage#967 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
cypress-io/code-coverage#959 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
performance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
cypress-io/code-coverage#933 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cypress-io/code-coverage
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
"Claude Code request is missing its initial user message" when the prompt starts with an image pathĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
earendil-works/pi-claude-code#31 ·
Maintainer thường phản hồi trong vòng 8 ngày
-
bug pending triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
privatenumber/cleye#48 ·
-
Google text documents are base64-encoded twiceCó thể đã có người làm @feiiiiii5 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày