2

I use Visual Studio 2012 and ReSharper 8.2 to test my JavaScript code. Using QUnit works perfectly so far, when writing Jasmine tests the tests don't stop when the following line is added at the beginning of the file:

/// <reference path="../lib/jasmine.js" />

When I remove it, the tests stop soon, as it should be. I would like to keep this line though so VS knows the syntax of the Jasmine commands. It doesn't matter whether I use phantom.js or not. The behaviour is the same.

According to http://www.philliphaydon.com/2013/10/running-javascript-unit-tests-in-visual-studio-with-jasmine-and-resharper/ and Jasmine + Pahtom.js + ReSharper : Test session don't stop after execution and Why does adding a reference to jasmine.js break my ReSharper test? I am not the only one with the problem. The first page says to use Chutzpah, the second doesn't give an answer and the third one seems to have the problem due to the Angular framework.

Chutzpah might be a workaround, but I'd like to stick to the ReSharper solution instead of adding another library.

Does anybody know an answer to this problem?

Community
  • 1
  • 1
telandor
  • 869
  • 9
  • 28
  • 1
    Please try selecting ReSharper | Options | Tools | Unit Testing | JavaScript Tests | Jasmine version | 2.0. – Alexander Kurakin Apr 17 '14 at 11:45
  • 1
    In this case, did you try to select 1.3 instead of 2.0 there? If you tried, but it still didn't work, please install jasmine-2.0 nuget package via Nuget Package Manager to the test project, point this new ../Script/jasmine/jasmine.js file in your tests, select "2.0" in ReSharper options and run tests again. Will it work? – Alexander Kurakin Apr 21 '14 at 14:29
  • Thank you. When I run a single test it works now. When I run all Unit Tests (CTRL+U, R) then the following error appears: "Could not build the projects. Tests will not be run. The build of project xy has failed." I could deactivate the automatic build process but that is actually not what I want. – telandor Apr 22 '14 at 06:39
  • Also see http://stackoverflow.com/questions/33757264/state-of-jasmine-unit-test-support-of-resharper-2016-debug-mode-and-amd-modules – Stefan Apr 07 '17 at 19:07

0 Answers0