Test runner: --test-reporter-destination should create the folder if not found
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.3k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 283
Mô tả
What is the problem this feature will solve?
Hi 👋
Fairly easy one:
I have node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" outputting the coverage file to the coverage folder.
However, if the coverage folder does not exist beforehand, an ENOENT is thrown.
Since storing the behavior of storing coverage in coverage/lcov.info, and having that folder in .gitignore is rather standard, it'd be nice to have Node creating the folder in which it will place the coverage report in case it doesn't exist.
Thanks :)
What is the feature you are proposing to solve the problem?
When writing coverage report, check if the destination folder exists, and if not, create it beforehand
What alternatives have you considered?
- version controlling the coverage folder with a
.gitkeepfile, but it's cumbersome - Having the CLI
testscript in my package json create the folder itself, but that's quite inelegant to maintain for both Windows and Unix users - Switching to another test runner and losing all the charisma points that come with using the native one
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.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề với lệnh được cung cấp node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" khi coverage không tồn tại. Theo dõi cách test runner xử lý đích của reporter và xác minh rằng thư mục đích được tạo trước khi báo cáo coverage được ghi, kể cả khi cần các thư mục lồng nhau.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js
- Lĩnh vực
- cli, testing-qa
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100