Testing framework feedback and improvements
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- typescript
- 領域
- testing-qa
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- TypeScript
- 星號
- 18.7k
- 分支
- 396
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
subquery/subql 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 45/100
-
難度 4/5 3-5 天 新手友好度 48/100
-
難度 4/5 3-5 天 新手友好度 25/100
-
難度 3/5 1-2 天 新手友好度 35/100
-
難度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
resources
難度 2/5 1-3 小時 新手友好度 72/100
railmapgen/rmg-palette#2445 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
danielmiessler/LifeOS#2242 ·
維護者通常 5 天內回覆
-
good first issue hacktoberfest help wanted translation
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
callstackincubator/appduct#129 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 88/100