Jasmine Karma错误“在afterAll \ nUncaught ReferenceError中引发了错误:未定义容器引发" [英] Jasmine Karma Error "An error was thrown in afterAll\nUncaught ReferenceError: container is not defined thrown"

查看:289
本文介绍了Jasmine Karma错误“在afterAll \ nUncaught ReferenceError中引发了错误:未定义容器引发"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过业力测试运行程序运行茉莉花测试时,我总是收到错误消息,

I keep getting an error when running jasmine tests via karma test runner, which reads like this:

{
    "message": "An error was thrown in afterAll\nUncaught ReferenceError: container is not defined thrown",
    "str": "An error was thrown in afterAll\nUncaught ReferenceError: container is not defined thrown"
  }

我的package.json如下:

My package.json is as follows:

 {
  "name": "3dm",
  "version": "1.0.0",
  "description": "3dm",
  "main": "src/index.html",
  "dependencies": {
    "three-obj-loader": "^1.1.3",
    "three.js": "*"
  },
  "devDependencies": {
    "jasmine-core": "^3.2.1",
    "karma-chrome-launcher": "*",
    "karma-cli": "*",
    "karma-jasmine": "^1.1.2",
    "istanbul": "^0.4.5",
    "jasmine": "^3.2.0",
    "karma": "^2.0.5",
    "karma-coverage": "^1.1.2",
    "karma-coverage-istanbul-reporter": "^2.0.3",
    "karma-htmlfile-reporter": "^0.3.6",
    "karma-istanbul-preprocessor": "*",
    "karma-jasmine-html-reporter": "^1.3.1",
    "karma-junit-reporter": "^1.2.0",
    "karma-rollup-preprocessor": "^5.1.1"
  },
  "author": "",
  "license": "ISC"
}

在我的测试中,我什至没有像Afterall或Sth之类的东西.通过jasmine Web界面执行测试,一切正常.仅在CLI级别上,我会遇到此问题.有人有想法吗?

in my tests I don't even had anything like afterall or sth. Executing the tests via jasmine web interface everything works well. Just on CLI level I get this issue. Any ideas someone?

推荐答案

弄清楚了.这是因为我重命名了一个文件,该文件通过通配符加载在karma.conf.js中,并且明确排除了我的文件名已从一个小写字母更改为一个大写字母.通过在明确排除的文件中对该名称进行调整,它可以像超级按钮一样工作

Figured it out. It was because I had renamed a file that in karma.conf.js was loaded via wildcard and explicitly excluded whose filename I had changed from one lower case letter to an upper case letter. With adjustment of that name in the explicitly excluded file it works like a charm

这篇关于Jasmine Karma错误“在afterAll \ nUncaught ReferenceError中引发了错误:未定义容器引发"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆