nodejs / nodejs/node

More benchmarks for the `node:test` module.

Aperta
#55,723 16 commenti 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

The benchmark/test_runner folder currently contains benchmarks for it and describe functions. I suggest we expand these benchmarks to cover additional test runner features, including mocks, coverage, and various test modes.

Here are the functions that (IMO) should be benchmarked:

Basic Testing

These tests should run with a custom reporter without any special logic to make the tests as accurate as possible.

  • test
    • Create a test (#56479)
    • Create a test when it's not running due to only
    • Add a subtest
    • Skip a test
      • Via skip: true
      • Via t.skip()
      • Via t.skip(...)
    • TODO tests
      • Via todo: true
      • Via t.todo()
      • Via t.todo(...)

Hooks

  • beforeEach
  • afterEach
  • before
  • after

Reporters (#55757)

  • dot
  • junit
  • spec
  • tap
  • lcov

Mocking

  • mock.fn (#55771)
  • mock.timers for each API, and each sub-function
  • mock.module

Snapshots

  • snapshot.setDefaultSnapshotSerializers(serializers)
  • snapshot.setResolveSnapshotPath(fn)
  • t.assert.snapshot

Coverage

Use --expose-internals to exclusively test the coverage part

  • Basic
  • Excluding files
  • Including files
  • With source maps

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 in benchmark/test_runner e passa in rassegna i benchmark esistenti per it, describe e le funzionalità completate di test-runner. Aggiungi benchmark per i casi non spuntati mock.timers, mock.module, snapshot e coverage, usando un reporter personalizzato e --expose-internals per coverage. Il lavoro è completo quando gli elementi rimanenti della checklist sono coperti senza logica speciale per i benchmark.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.