caolan / caolan/nodeunit

How to know when all tests (or all in a testCase) are done

未关闭
#72 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
1.9k
派生
359
PR 合并指标
30 天内没有已合并 PR

描述

Is there any way to know when all of the tests are done, either via an event or via a callback? E.g. you are testing a node app, and are using either a remote service, or another service, etc. There is tearDown for the entire suite (or at least testCase) that you want to perform. setUp is easy, just call it before even setting up the testCase, but what about tearDown?

Conversely, can a testCase have another testCase? e.g.

tests = nodeunit.testCase({
setUp: // some wide setup
tearDown: // some wide teardown
testAll: nodeunit.testCase({
setUp: // per test setup
tearDown: // per test tearDown
testA: function() {... },
testB: function() {... },
testC: function() {... }
})
});

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先阅读 nodeunit.testCase 的生命周期,以及当前如何处理 setUp 和 tearDown。确定所请求的行为是用于完成的事件或 callback、对嵌套 testCase 的支持,还是两者兼有。Done 应提供一种明确的方式,在一个 suite 或 test case 中的所有测试完成后执行 teardown,并确保嵌套 case 的行为一致。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
testing
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。