nodejs / nodejs/node

`node:test` Tests without callback should not be reported as ok

Aperta
#65,563 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

Version

26.7.0

Platform

Subsystem

No response

What steps will reproduce the bug?
describe('two todos', () => {
  // TODO
  it('should handle first case', (t) => {
    t.todo();
  });

  // TODO
  it('should handle second case');
});

This would report as

ℹ tests 2
ℹ suites 1
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 1
How often does it reproduce? Is there a required condition?

Deterministic

What is the expected behavior? Why is that the expected behavior?

A test with no body, thus that doesn't test anything, should not be reported as OK.

It usually indicates a test that's TODO, so the existing feature of reporting todos may be the most relevant option there, and I think (?) it would be non-breaking for existing test suites.

What do you see instead?

TODO/incomplete test reported as pass

Additional information

Hi there 👋

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Inizia riproducendo il problema con l’esempio describe/it di node:test fornito su Node.js 26.7.0, quindi traccia il modo in cui i test senza callback vengono classificati nell’implementazione di node:test e nei relativi test. Il lavoro è completato quando un test vuoto non viene più segnalato come superato e viene classificato in modo coerente con il comportamento todo previsto, preservando la reportistica dei test esistente.

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

Valutazione

Stack tecnologico
javascript, node.js
Ambito
testing-qa
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.