首页 > 解决方案 > Ember-qunit 单元测试失败,全局错误 Ajax 中止

问题描述

有没有人遇到过这个问题?我正在本地运行 ember-qunit 的单元测试,得到这个全局错误,Ajax 被中止。谢谢!

ok 1 Chrome 92.0 - [1 ms] - ESLint | app: services/something.js
ok 2 Chrome 92.0 - [0 ms] - ESLint | tests: unit/services/something-test.js
not ok 3 Chrome 92.0 - [undefined ms] - Global error: Uncaught Error: The ajax operation was aborted at http://localhost:7357/assets/vendor.js, line 36784
 While executing test: Unit | Service | something: should correctly concat foo
    ---
        browser log: |
            testContext: [object Object]
            ERROR: Uncaught Error: The ajax operation was aborted at http://localhost:7357/assets/vendor.js, line 36784

    ...
not ok 4 Chrome - [undefined ms] - error
    ---
        message: >
            Error: Browser timeout exceeded: 10s
            Error while executing test: Unit | Service | something: should correctly concat foo
            Stderr:

            DevTools listening on ws://127.0.0.1:9222/devtools/browser/53946c78-c3da-4f52-9744-bd71040066fc


        browser log: |
            [object Object]
            [object Object]
            [object Object]
    ...

1..4
# tests 4
# pass  2
# skip  0
# fail  2
Testem finished with non-zero exit code. Tests failed.

标签: ajaxunit-testingember.jsglobalqunit

解决方案


推荐阅读