Here is an example for Qunit test async, i want to finish it (result of the test) into the function async like is this example setTimeout :

这是Qunit测试异步的一个例子,我想完成它(测试的结果)到函数async就像这个例子setTimeout:

QUnit.test("test", function(assert) {
    var done = assert.async(10); // 10 is just example
    assert.ok(true, "succed");
    done();
    setTimeout(function () {
    // here callback async, i want to finish the test, 
    // but i don't know the vlaue of acceptCallCount (assert.async(acceptCallCount));

    }, 1000);
    assert.ok(true, "succed");
    done();
});

1 个解决方案

#1


0

(this is more a comment however too new for SO to comment!)

(这更像是一条评论,但对SO来说太新了评论!)

note that 'async' function comes with Qunit 2. Check your Qunit version.

请注意Qunit 2附带的'async'功能。检查您的Qunit版本。

Note that all the new APIs of QUnit 2.0 are already usable in QUnit 1.23.0

请注意,QUnit 2.0的所有新API都已在QUnit 1.23.0中使用

if you are before 1.23.0, you should upgrade or use the old method with Qunit.start().

如果您在1.23.0之前,则应该使用Qunit.start()升级或使用旧方法。

更多相关文章

  1. Node.js嬉皮API测试模块安装
  2. js“DOM事件”之鼠标事件、js的测试方法、js代码的放置位置
  3. 如何测试从实时网站提取数据的AJAX应用程序?
  4. JavaScript中可见性检查的测试条件
  5. 如何测试一个点是否是二次Bézier曲线的一部分?
  6. chai-as-promised:单个测试中的多个期望语句
  7. 如何测试潜在的“浏览器崩溃”JavaScript?
  8. How to learn js properly(week4)使用js建立的动态测试网页
  9. Python PyV8安装测试(Win7)

随机推荐

  1. 用Python生成抖音字符视频!
  2. 用Python将HTML转为PDF。
  3. 怎样与 CORS 和 cookie 打交道[每日前端
  4. 我怎样用Node.js自动完成工作的[每日前端
  5. 学习C语言的历程
  6. 为什么GraphQL是API的未来[每日前端夜话0
  7. 新浪微博评论爬取。
  8. 如何用WebAssembly为Web应用提速20倍
  9. MySQL事务处理及字符集和校对顺序
  10. java爬虫-初识