Angular/Firebase testing errors

126 views
Skip to first unread message

Machiko Yasuda

unread,
Sep 4, 2013, 9:14:18 PM9/4/13
to ang...@googlegroups.com
Hi - I am writing my first Angular app and I cannot get my unit tests to run. It uses Firebase real-time database, Jasmine and Karma for testing. I generated my app with Yeoman's Angular generator. It seems as though some part of the initial test dependency injection is failing. 

I am using the latest version of Angular: 1.0.8

Here's the GitHub repo for my project: https://github.com/machikoyasuda/angular-checklist

Here's a Plunker with some of the code. See the error messages: http://embed.plnkr.co/LIcX1J7ZncZxBNLX67QC/preview

I cannot get any tests to run. How should I change my injection code to get the test to run? 

Here's what I did:

- Generate an app with Yeoman and Bower
- Use the generic config file, but add two lines into the list of files to be loaded - to load AngularFire and Firebase

- After I run the test, I get this error

Error: Argument 'fn' is not a function, got undefined
    at assertArg (/app/bower_components/angular/angular.js:1099:11)
    at assertArgFn (/app/bower_components/angular/angular.js:1109:3)
    at annotate (/app/bower_components/angular/angular.js:2485:5)
    at Object.invoke (/app/bower_components/angular/angular.js:2969:21)
    at /app/bower_components/angular/angular.js:2929:43
    at Array.forEach (native)
    at forEach (/app/bower_components/angular/angular.js:130:11)
    at loadModules (/app/bower_components/angular/angular.js:2900:5)
    at Object.createInjector [as injector] (/app/bower_components/angular/angular.js:2842:11)
    at workFn (/app/bower_components/angular-mocks/angular-mocks.js:1791:45)

(1 FAILED) ERROR (0.242 secs / 0.022 secs)
Warning: Task "karma:unit" failed. Use --force to continue.

Machiko Yasuda

unread,
Sep 4, 2013, 9:15:17 PM9/4/13
to ang...@googlegroups.com
Here's the test code, specifically: http://embed.plnkr.co/LIcX1J7ZncZxBNLX67QC/appSpec.js
Reply all
Reply to author
Forward
0 new messages