1

When running Jasmine tests from Resharper I get the following error for all tests, however the same tests succeed when initiated directly from the Chutzpah extension in Visual Studio.

Jasmine 2.0.0
finished in 0.106s
10 specs, 10 failures
Spec List | Failures
UI.tools Tests (name)
ReferenceError: setFixtures is not defined
ReferenceError: setFixtures is not defined
    at Object.<anonymous> (http://localhost:16026/Tests.js:19:9)
    at attemptSync (http://localhost:16026/jasmine.js:1510:12)
    at QueueRunner.run (http://localhost:16026/jasmine.js:1498:9)
    at QueueRunner.execute (http://localhost:16026/jasmine.js:1485:10)
    at Spec.Env.queueRunnerFactory (http://localhost:16026/jasmine.js:518:35)
    at Spec.execute (http://localhost:16026/jasmine.js:306:10)
    at Object.<anonymous> (http://localhost:16026/jasmine.js:1708:37)
    at attemptAsync (http://localhost:16026/jasmine.js:1520:12)
    at QueueRunner.run (http://localhost:16026/jasmine.js:1496:16)
    at QueueRunner.execute (http://localhost:16026/jasmine.js:1485:10)
Expected 0 to be 1.
Error: Expected 0 to be 1.
    at stack (http://localhost:16026/jasmine.js:1293:17)
    at buildExpectationResult (http://localhost:16026/jasmine.js:1270:14)
    at Spec.Env.expectationResultFactory (http://localhost:16026/jasmine.js:484:18)
    at Spec.addExpectationResult (http://localhost:16026/jasmine.js:260:46)
    at Expectation.addExpectationResult (http://localhost:16026/jasmine.js:442:21)
    at Expectation.toBe (http://localhost:16026/jasmine.js:1209:12)
    at Object.<anonymous> (http://localhost:16026/Tests.js:34:68)
    at attemptSync (http://localhost:16026/jasmine.js:1510:12)
    at QueueRunner.run (http://localhost:16026/jasmine.js:1498:9)
    at QueueRunner.execute (http://localhost:16026/jasmine.js:1485:10)
Stelloy
  • 2,316
  • 1
  • 19
  • 26

1 Answers1

1

tl;dr version - I upgraded Resharper and it works now.

I found the issue with some hunting. After reading this question I went and checked the source of the page R# was generating, and sure enough while jasmine.js and jasmine.css were being loaded prior to my references, resharper-utils.js, jasmine2ResharperReporter.js, jasmine-html.js and boot.js were being loaded after. Most of these are dynamically generated by the tool so manually referencing them seemed to be the wrong thing to do.

I did some more looking and it turns out there's a bug in Resharper 8.2.0 - all I had to to was upgrade to a newer version (8.2.1+) and the issue was fixed.

Community
  • 1
  • 1
Stelloy
  • 2,316
  • 1
  • 19
  • 26