Why does adding a link to jasmine.js break my ReSharper test?

I am trying to use Resharper to run my Javascript unit tests using phantomJS [Headless] with Visual Studio. When I include a jasmine link in my file, it interrupts the test. However, if I comment on the top line, it works. What for? my test is written in jasmine syntax ...

/// <reference path="../jasmine/jasmine.js"/> <-- when I comment this, tests work /// <reference path="../angular-loader.js"/> /// <reference path="../angular-mocks.js"/> /// <reference path="../angular.js"/> /// <reference path="../teststuff/app.js"/> describe('jasmineApp', function () { var scope = {}; scope.name = ''; beforeEach(angular.mock.module('jasmineApp')); beforeEach(angular.mock.inject(function ($rootScope, $controller) { scope = $rootScope.$new(); $controller('jasmineAppController', { $scope: scope }); })); it('name is eric', inject(function () { expect(scope.name).toEqual("eric"); })); }); 
+2
source share
1 answer

I think that since Angular comes bundled with Karma by default - and Karma supports tests with Jasmine window syntax.

Somewhere structure failure may occur ...

So just remove the inclusion of Jasmine (the line you are already commenting on) and everything will be fine.

0
source

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


All Articles