0

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

bfout
  • 33
  • 2

1 Answers1

0

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"
}
Matthew Manela
  • 16,572
  • 3
  • 64
  • 66