TomFree
TomFree

Reputation: 1389

Jasmine Karma Error "An error was thrown in afterAll\nUncaught ReferenceError: container is not defined thrown"

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"
  }

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"
}

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?

Upvotes: 1

Views: 8377

Answers (1)

TomFree
TomFree

Reputation: 1389

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

Upvotes: 1

Related Questions