setFixtures 未定义:Jasmine 测试在 运行 时由 Resharper 而不是 Chutzpah 失败

setFixtures is not defined: Jasmine tests failing when run by Resharper but not Chutzpah

当 运行 来自 Resharper 的 Jasmine 测试时,我得到以下所有测试的错误,但是当直接从 Visual Studio 中的 Chutzpah 扩展启动时,相同的测试成功。

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)

tl;dr 版本 - 我升级了 Resharper,现在可以使用了。

我发现了一些狩猎问题。阅读 this question 后,我检查了 R# 生成的页面的源代码,果然 jasmine.jsjasmine.css 在我的引用 resharper-utils.js 之前加载, jasmine2ResharperReporter.jsjasmine-html.jsboot.js 之后被加载。其中大部分是由工具动态生成的,因此手动引用它们似乎是错误的做法。

我又看了看,结果发现有 a bug in Resharper 8.2.0 - 我所要做的就是升级到更新的版本 (8.2.1+),问题就解决了。