【问题标题】:setFixtures is not defined: Jasmine tests failing when run by Resharper but not ChutzpahsetFixtures 未定义:Jasmine 测试在由 Resharper 而不是 Chutzpah 运行时失败
【发布时间】:2015-08-12 09:11:45
【问题描述】:

从 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)

【问题讨论】:

    标签: jquery jasmine resharper chutzpah


    【解决方案1】:

    tl;dr 版本 - 我升级了 Resharper,它现在可以工作了。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多