带有茉莉花的业力不会打印任何有用的错误

Karma with jasmine does not print any useful error

提问人:Leos Literak 提问时间:11/11/2023 更新时间:11/11/2023 访问量:19

问:

有一个带有业力 + 茉莉花测试的 angular 15.2 项目。Jenkins 的测试失败了,几乎没有信息原因。

Chrome Headless 117.0.5938.132 (Windows 10): Executed 4 of 227 SUCCESS (0 secs / 0.292 secs)
Chrome Headless 117.0.5938.132 (Windows 10): Executed 5 of 227 SUCCESS (0 secs / 0.325 secs)
Chrome Headless 117.0.5938.132 (Windows 10): Executed 5 of 227 (skipped 222) SUCCESS (0.418 secs / 0.325 secs)
11 11 2023 13:01:41.295:DEBUG [launcher]: CAPTURED -> BEING_KILLED
11 11 2023 13:01:41.295:DEBUG [launcher]: BEING_KILLED -> BEING_FORCE_KILLED

angular.json

            "test": {
                "builder": "@angular-devkit/build-angular:karma",
                "options": {
                    "karmaConfig": "karma.conf.js",
                    "polyfills": ["zone.js", "zone.js/testing"],
                    "tsConfig": "tsconfig.spec.json",

业力.conf.js

module.exports = function (config) {
config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
        require('karma-jasmine'),
        require('karma-chrome-launcher'),
        require('karma-jasmine-html-reporter'),
        require('karma-coverage'),
        require('@angular-devkit/build-angular/plugins/karma')
    ],
    client: {
        captureConsole: true,

我怎样才能获得更多的信息?我需要在浏览器中本地运行测试才能查看:

Chrome 117.0.0.0 (Windows 10): Executed 5 of 227 (skipped 222) SUCCESS (0.361 secs / 0.287 secs)
Incomplete: fit() or fdescribe() was found, 5 specs, 0 failures, randomized with seed
业力-茉莉花

评论

0赞 jsonderulo 11/12/2023
听起来它成功地执行了 5 个并跳过了其余的?你下面有一个有 5 个测试用例的块吗?或者,5个测试用例分散在您的测试套件中?如果 Jasmine 检测到和/或fdescribe fitfdescribefit
0赞 Leos Literak 11/13/2023
是的,测试中有一个错误。我担心的是输出没有清楚地说明错误,因此更难发现它。

答: 暂无答案