Chutzpah links js files as test files in Visual Studio 2013

I am using Chutzpah in Visual Studio 2013 Update 2, and I am trying to run some unit tests using jasmine for AngularJS. The problem is, for some reason, chutzpan thinks my javascript referenced files are files for testing.
No matter where I include the link 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 I'm wrong about? Thank!

Refresh . So guys, I solve the problem by simply adding link files to both test files and chutzpah.json.

+4
source share
1 answer
+3

Source: https://habr.com/ru/post/1542464/


All Articles