Test harness stops at the first thrown error and prints a stale check count

Aberta
#203 1 comentário 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
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript, nodejs
Domínio
testing-qa

Direção de pesquisa

The harness is hand-rolled eq/has/throws helpers in site/checks.test.mjs (around lines 52-75 and the summary near 817-822) and site/lib/lib.test.mjs (lines 16-38 and the summary near 1156-1162). Read those helpers and run npm test to see how one thrown exception stops the run. Done means a thrown error in one section no longer hides later results, the printed check count matches the real number of sections, and a single test can be selected by name, ideally via node:test's --test-name-pattern while keeping npm test as the entry point.

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

Descrição

help wanted priority: low tests

Summary

Both test files hand-roll eq/has/throws. An exception inside any section (as opposed to a failed eq) kills the process before the failure report prints, hiding every later assertion.

Where

  • site/checks.test.mjs:52-75, 817-822
  • site/lib/lib.test.mjs:16-38, 1156-1162

Details

checks.test.mjs prints a hard-coded "across 30 checks" while the file has 26 V-sections. lib.test.mjs is 1,163 lines in one scope and is the most-changed file in the repo.

Impact

One crash masks all other failures; no way to run a single test.

Suggested fix

Migrate section by section to the built-in node:test + node:assert (ships with Node 22, no dependency): per-test isolation, --test-name-pattern, real counts. Keep npm test as the entry point.

Acceptance criteria

  • A thrown error in one test does not hide the others
  • npm test reports real counts
  • A single test can be run by name

Getting started

  • Relevant files: site/checks.test.mjs, site/lib/lib.test.mjs, package.json
  • How to run tests: npm test (unit tests), npm run check (tests + validate + build). Node 22+, no dependencies.
  • Related docs: site/README.md, CONTRIBUTING.md

Filed by repo-audit/full-audit at 982fcd9. Severity: low. Effort: M. audit-key: testing|site/lib/lib.test.mjs|harness

Linguagem predominante
JavaScript
Estrelas
58
Forks
15
Merge médio
1d 14h
PRs com merge (30d)
11

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 TMHSDigital/Free-Game-Dev-Assets

Todas as issues de TMHSDigital/Free-Game-Dev-Assets

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

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