Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Testing framework feedback and improvements

Aberta
#1,663 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
typescript
Domínio
testing-qa

Direção de pesquisa

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.

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

Descrição

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
Linguagem predominante
TypeScript
Estrelas
18.7k
Forks
396
Métricas de merge de PRs
Nenhum PR com merge em 30d

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

Todas as issues de subquery/subql

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.