Add unit tests for the mail text helpers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- testing
調査の方向性
packages/mail/src/text.tsとpackages/mail/test内の近くにあるテストを読み、Vitestの規約に従ってください。issueに列挙された7つのケース群を含むpackages/mail/test/text.test.tsを追加し、text.tsは変更せず、架空のアドレスのみを使用してください。pnpm --filter @hermit/mail testとpnpm --filter @hermit/mail test test/text.test.tsを実行してください。新しいテストが成功し、期待値を意図的に壊すと失敗することが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 11
- フォーク
- 0
- 平均マージ
- 10分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DojoCodingLabs/hermit のほかの issue
-
docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
DojoCodingLabs/hermit#73 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DojoCodingLabs/hermit#45 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
DojoCodingLabs/hermit#44 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DojoCodingLabs/hermit#43 ·
メンテナーはふだん 1 日以内に返信
-
agent-friendly docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
DojoCodingLabs/hermit#39 ·
メンテナーはふだん 1 日以内に返信
DojoCodingLabs/hermit の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
superlinked/sie#1033 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
remix-run/react-router#15838 ·
メンテナーはふだん 1 日以内に返信
-
area/ci bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melgarafael/DeskcommCRM#5290 ·
メンテナーはふだん 1 日以内に返信