0
votes

I'm trying to learn how to perform unit testing for Angular controllers, services, etc in Visual Studio 2012 using Chutzpah and Jasmine.

All of my tests work fine when executed from a test page (TestRunner.html) that I created, but one of them fails when I try to execute it from Chutzpah.

The error message that I'm getting is:

Test 'userData getUser:should call getresource.get with the username' failed TypeError: 'undefined' is not an object (evaluating 'currentSpec.queue.running') in Error: [$injector:unpr] Unknown provider: userResourceProvider <- userResource <- userData

I created a repo on GitHub - https://github.com/bfout/Angular-Unit-Testing

1

1 Answers

0
votes

Your project is using Jasmine v1 but by default Chutzpah uses Jasmine v2. To change this add a chutzpah.json file to your project with the following contents. When I did this your tests passed.

{
    "FrameworkVersion": "1",
    "Framework": "Jasmine"
}