Test the device table's notes and its sort order

Aperta Adatta ai principianti
#34 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
testing

Direzione di ricerca

Leggi scripts/devices/table.test.mjs e scripts/devices/fixtures/good-report.json, poi esamina come l’helper esistente faster() costruisce i report e come viene chiamato renderTable(). Aggiungi test per le note e l’ordine di ordinamento specificati, lasciando invariati table.mjs e il fixture. Esegui node --test scripts/devices/table.test.mjs e pnpm test; il lavoro è completo quando i nuovi test passano e viene dimostrato che ciascun test fallisce se un’aspettativa viene violata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
11
Fork
0
Merge medio
10m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DojoCodingLabs/hermit

Tutte le issue di DojoCodingLabs/hermit

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.