Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Testing framework feedback and improvements

Aperta
#1,663 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
testing-qa

Direzione di ricerca

Start by locating the current testing framework and the testenv.exec entry point, then compare how handlers and filters are tested today. Done should include a decided design and tests covering handler hit counts, event order and input assertions, deletion, and intermediate results.

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

Descrizione

The current testing framework is a good step to being able to check a handlers and filters but has some limitations. Based on feedback we can make improvements to give more control over tests

Example:
import {xxx_event_handler} from '../src/';

it('test XXX event handler for block #123', async () => {
    store = Mock.fn();...
    // blockheight, handler_name, injection, callback
    await testenv.exec(1234, 'xxx_event_handler', {store}, (data) => {
        // assert data.length, how many times it is expected to be hit at this height
        // loop data element, assert content/order of the matching events
        // invoke real handler
        for (const evt of data) {
            await xxx_event_handler(evt);
            // write store asserts
        }
    })
}); 
Advantages:
  • more assertions than the store output, e.g
    • times the handler is hit in the given height
    • order of events hitting the given handler
    • assert the input of the handler
  • assert deletion
  • assert intermediate results
Lingua principale
TypeScript
Stelle
18.7k
Fork
396
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 subquery/subql

Tutte le issue di subquery/subql

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.