Test the device table's notes and its sort order

Aberta Para iniciantes
#34 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
90/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
javascript, node.js
Domínio
testing

Direção de pesquisa

Leia scripts/devices/table.test.mjs e scripts/devices/fixtures/good-report.json; em seguida, examine como o helper existente faster() cria relatórios e como renderTable() é chamado. Adicione testes para as observações e a ordem de classificação especificadas, mantendo table.mjs e o fixture inalterados. Execute node --test scripts/devices/table.test.mjs e pnpm test; o trabalho estará concluído quando os novos testes passarem e for demonstrado que cada teste falha quando uma expectativa é quebrada.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
TypeScript
Estrelas
11
Forks
0
Merge médio
10min
PRs com merge (30d)
6

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de DojoCodingLabs/hermit

Todas as issues de DojoCodingLabs/hermit

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.