Stoyan Stoyanov
Stoyan Stoyanov

Reputation: 135

Chutzpah executes reference js files as test ones in Visual Studio 2013

I am using Chutzpah in Visual Studio 2013 Update 2, and I am trying to do some unit testing using jasmine for AngularJS. The problem is that for some reason chutzpan thinks my reference javascript files are files to test.
No matter where I include the reference files (in the test file or Chutzpah.json), I get the same errors.
For example, if I include:

/// <reference path="Scripts/angular.js" />
/// <reference path="Scripts/angular-mocks.js" />
/// <reference path="../codeToTest" />

describe('Controller: myController', function () {

    beforeEach(module('myApp'));
});

I get:

Error: TypeError: 'undefined' is not an object (evaluating 'angular.mock = {}')  

and

ReferenceError: Can't find variable: module in file.

Any ideas where I am wrong? Thank you!

Update: So guys, I solve the problem just by adding reference files in both test files and chutzpah.json.

Upvotes: 4

Views: 3185

Answers (1)

Tibi
Tibi

Reputation: 1547

You have two choices here. You can either create a chutzpah.json file and include the references there, or you can change /// reference to /// chutzpah_reference You can find more info here: https://chutzpah.codeplex.com/wikipage?title=Chutzpah%20File%20References

Upvotes: 3

Related Questions