Test the device table's notes and its sort order

Abierto Apto para principiantes
#34 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
90/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, node.js
Área
testing

Línea de trabajo

Lee scripts/devices/table.test.mjs y scripts/devices/fixtures/good-report.json; después, examina cómo el helper existente faster() construye informes y cómo se llama a renderTable(). Añade pruebas para las notas y el orden de clasificación especificados, dejando table.mjs y el fixture sin cambios. Ejecuta node --test scripts/devices/table.test.mjs y pnpm test; el trabajo estará terminado cuando las nuevas pruebas pasen y se haya demostrado que cada prueba falla al romper una expectativa.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

agent-friendly good first issue

Why

scripts/devices/table.mjs builds the device table in docs/devices.md from Device lab reports, and some of its notes and its tie-breaks have no test yet. Those rows matter as reports arrive (ROADMAP.md, Now: the Device lab).

What to do

Today scripts/devices/table.test.mjs covers "battery saver on" and "paused once for heat". Add tests there, building made-up reports from scripts/devices/fixtures/good-report.json the way its faster() helper does, and passing them to renderTable():

  1. Notes: device.lowRam: true shows "low-RAM device"; run.thermalPauses: 3 shows "paused 3 times for heat"; a report with battery saver on, low RAM and two pauses shows all three, in that order, joined by ", ".
  2. Sort order: with equal speed.tokensPerSecond, rows go by phone name (maker and model) from A to Z; with the same phone and speed, the newer run.date comes first.
  3. Check that each new test can fail: break one expectation on purpose, see it fail, put it back.

Done when

  • The new tests pass, and scripts/devices/table.mjs is unchanged.
  • scripts/devices/fixtures/good-report.json is unchanged: other tests depend on it.

How to check

node --test scripts/devices/table.test.mjs
pnpm test

Keep in mind

  • Tests only. If a test shows a real bug, open a bug report and leave table.mjs alone in this pull request.
  • Made-up phones only, like the Examplecorp EX-1000 in the fixture.
Lenguaje dominante
TypeScript
Estrellas
11
Forks
0
Merge medio
10 min
PR fusionados (30 d)
6

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DojoCodingLabs/hermit

Todos los issues de DojoCodingLabs/hermit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.