Add unit tests for the mail text helpers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- testing
Línea de trabajo
Lee packages/mail/src/text.ts y una prueba cercana en packages/mail/test para seguir las convenciones de Vitest. Añade packages/mail/test/text.test.ts con los siete grupos de casos enumerados en la issue, deja text.ts sin cambios y usa únicamente direcciones ficticias. Ejecuta pnpm --filter @hermit/mail test y pnpm --filter @hermit/mail test test/text.test.ts; el trabajo estará terminado cuando las nuevas pruebas pasen y fallen si se rompe deliberadamente una expectativa.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 11
- Forks
- 0
- Merge medio
- 10 min
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DojoCodingLabs/hermit
-
docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
DojoCodingLabs/hermit#73 ·
Los mantenedores suelen responder en 1 día
-
device-lab
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DojoCodingLabs/hermit#45 ·
Los mantenedores suelen responder en 1 día
-
device-lab
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
DojoCodingLabs/hermit#44 ·
Los mantenedores suelen responder en 1 día
-
device-lab
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DojoCodingLabs/hermit#43 ·
Los mantenedores suelen responder en 1 día
-
agent-friendly docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
DojoCodingLabs/hermit#39 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DojoCodingLabs/hermit
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
superlinked/sie#1033 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
remix-run/react-router#15838 ·
Los mantenedores suelen responder en 1 día
-
area/ci bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
melgarafael/DeskcommCRM#5290 ·
Los mantenedores suelen responder en 1 día