Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Testing framework feedback and improvements

Đang mở
#1,663 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
18.7k
Fork
396
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của subquery/subql

Tất cả issue của subquery/subql

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.