注意:在网上查找ember.js时,我看到了类似的错误。我没有使用ember.js
我得到标题中所述的断言错误。看来,单独运行测试可以按预期通过,但在运行整个套件时却无法通过。我尝试过:
为测试设置更长的超时时间
在assert.expect()中期待更多断言
使用stop(),以便测试知道要等到值返回为止
升级qunitjs(当前使用版本2.3.3)
我的测试与此类似:
Qunit.test("description", (assert) => {
assert.expect(expected amount of assertions);
const done1 = assert.async();
const done2 = assert.async();
const test1 = function() {
// set parameters on a form here and check that they have been set
done1();
test2();
}
const test2 = function() {
// set parameters on a form here and check that they have been set
done2();
}
test1();
}