Testing Angular controller fails at CodeMirror/merge.js node.appendChild

We are attempting to test our project using Karma and PhantomJS. The main controller codeCtrl tests all fail with the following errors. It is acting like it is not aware of jQuery even though we have this listed as a dependency as the second “file” in the karma.conf.js. By the way, the application runs beautifully without error. We love CodeMirror and would love any insight on this testing error. Thank you!

PhantomJS 1.9.8 (Mac OS X)
1) TypeError: ‘null’ is not an object (evaluating ‘node.appendChild’)
at http://localhost:9876/base/client/codemirror/merge.js:2668
at http://localhost:9876/base/client/codemirror/merge.js:2637
at http://localhost:9876/base/client/app/services.js:104
at http://localhost:9876/base/client/app/main/main.js:27
at http://localhost:9876/base/client/app/main/main.js:76
at invoke (http://localhost:9876/base/client/bower_components/angular/angular.js:4203)
at instantiate (http://localhost:9876/base/client/bower_components/angular/angular.js:4211)
at http://localhost:9876/base/client/bower_components/angular/angular.js:8501
at http://localhost:9876/base/client/bower_components/angular-mocks/angular-mocks.js:1878
at http://localhost:9876/base/specs/mainCtrl_test.js:12
at invoke (http://localhost:9876/base/client/bower_components/angular/angular.js:4203)
at workFn (http://localhost:9876/base/client/bower_components/angular-mocks/angular-mocks.js:2436)
undefined