Angular Controller Tests unable to be run on Circle



I have a set of 2 test scripts, with a total of 6 angular controller test cases, which on previous builds were running fine. I have a new branch that I am testing on Circle, and while all 6 test cases pass locally, and on my teammate’s machine, using a clean build of my branch, when run on Circle all 6 fail to run, in the same way.

The app is built using Node, CoffeeScript, Angular, Hapi, Bootstrap, etc. The tests that we have the issue with are written with Jasmine, run by Karma using PhantomJS. Here is the type of error that we see for all the Angular controller test cases:

TypeError: undefined is not a function (evaluating ‘this.controller(‘LoginFormCtrl’, {
toastr: this.toastr
})’) in /home/ubuntu/highline/src/tests/browser/unit/contollers/LoginFormCtrl.spec.js (line 10)
/home/ubuntu/highline/src/tests/browser/unit/contollers/LoginFormCtrl.spec.js:10:32 <-

TypeError: undefined is not an object (evaluating 'this.httpBackend.expectPOST') in /home/ubuntu/highline/src/tests/browser/unit/contollers/LoginFormCtrl.spec.js (line 37)
/home/ubuntu/highline/src/tests/browser/unit/contollers/LoginFormCtrl.spec.js:37:21 <-

PhantomJS 2.1.1 (Linux 0.0.0): Executed 6 of 6 (6 FAILED) ERROR (0.043 secs / 0.027 secs)