Add unit tests for the mail text helpers
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
Đọc packages/mail/src/text.ts và một bài kiểm thử gần đó trong packages/mail/test để làm theo các quy ước của Vitest. Thêm packages/mail/test/text.test.ts với bảy nhóm trường hợp được liệt kê trong issue, giữ nguyên text.ts và chỉ sử dụng địa chỉ hư cấu. Chạy pnpm --filter @hermit/mail test và pnpm --filter @hermit/mail test test/text.test.ts; công việc hoàn tất khi các bài kiểm thử mới chạy thành công và thất bại nếu một kỳ vọng bị cố ý làm sai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why
packages/mail/src/text.ts turns Gmail, Outlook and IMAP message bodies into plain text, and none of its helpers has a test file of its own. ROADMAP.md, Now: mail is part of the everyday loop.
What to do
Create packages/mail/test/text.test.ts (Vitest, like the other files in packages/mail/test) and import from ../src/text.ts. Cover:
base64ToBytes: plain base64, base64url (-and_), and text with padding and line breaks.utf8DecodeanddecodeBase64Text: Spanish accents and ñ, a four-byte character, and a broken sequence that becomes U+FFFD.decodeEntities: named (á,ñ,&), decimal and hex references, and an unknown name left as it is.htmlToText:script,style,headandtitledropped with their contents, comments dropped, a line break atbr,p,div,liand headings, and no blank lines left.plainText: CRLF becomes LF, runs of spaces collapse, and at most one blank line remains in a row.clip: text at or under the limit unchanged; longer text cut, with "..." and no space before it.splitAddresses: commas inside quotes and inside angle brackets don't split; an empty or missing header gives an empty list.
Check that each test can fail: break one expectation on purpose, see it fail, put it back.
Done when
pnpm --filter @hermit/mail testruns the new file and it passes.packages/mail/src/text.tsis unchanged.
How to check
pnpm --filter @hermit/mail test
pnpm --filter @hermit/mail test test/text.test.ts
Keep in mind
- Tests only. If a test shows a real bug (for example,
clip("hello", 2)returns more than two characters), open a bug report and leavetext.tsalone here. - Leave
oneLine()out. It flattens fields other people control before the model reads them, so its tests get their own issue. - Made-up people and
example.comaddresses only. Never paste a real message.
- Ngôn ngữ chính
- TypeScript
- Star
- 11
- Fork
- 0
- Merge trung bình
- 10 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọ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 DojoCodingLabs/hermit
-
docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
DojoCodingLabs/hermit#73 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
device-lab
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
DojoCodingLabs/hermit#45 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
device-lab
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
DojoCodingLabs/hermit#44 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
device-lab
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DojoCodingLabs/hermit#43 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-friendly docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
DojoCodingLabs/hermit#39 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DojoCodingLabs/hermit
Issue tương tự
-
bug zoo
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
software-mansion/runntime#151 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
sidebandstudio/clawtrate#728 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement github_actions help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tranquilo-art/tranquilo-app#254 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Tfoucher5/fuzzy-toolkit#44 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
endora-commerce/endora-commerce#1978 ·
Maintainer thường phản hồi trong vòng 1 ngày