Argument 'dashboardCtrl' is not a function, got undefined

103 views
Skip to first unread message

Sachin Kumar

unread,
Jul 30, 2014, 5:42:51 AM7/30/14
to karma...@googlegroups.com
I've created test cases using Jasmine for angular application and all the test cases are successfully running but when I try to find code coverage using Karma it shows following error:
    Argument 'dashboardCtrl' is not a function, got undefined
Here 'dashboardCtrl' is controller name.

Image file is attached which showing the execution process and the config file of karma js is also attached. Please tell me the solution for this problem.
Karma.png
my.conf.js

Aymeric Beaumet

unread,
Aug 3, 2014, 8:36:41 PM8/3/14
to karma...@googlegroups.com
Your configuration seems pretty straightforward and it's hard to tell what's wrong with the information you provide.

However you can check if there are errors in your browser console:
- if so, write them here
- if not, try to include the files in your Karma conf in the same order as you do in the browser.

Vojta Jína

unread,
Aug 7, 2014, 5:45:21 PM8/7/14
to karma...@googlegroups.com, ang...@googlegroups.com
+angular

Sachin, your config looks correct to me. Maybe the coverage processing (Istanbul) somehow screws up Angular.
Can you check out the processed source file (in the browser, open web inspector, tab "scripts")?


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/karma-users/f9d90033-be8a-4050-8ecc-5c2e51890c0e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sachin Kumar

unread,
Aug 11, 2014, 9:24:13 AM8/11/14
to karma...@googlegroups.com
I have checked the console but there is no error.
Thanks

Vojta Jína

unread,
Aug 22, 2014, 7:40:23 PM8/22/14
to karma...@googlegroups.com
Can you check the processed source code? It's more likely the coverage instrumentation (done by Istanbul) does something that Angular does not like...


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
Reply all
Reply to author
Forward
0 new messages