如何在ReSharper中运行Jasmine JS?

时间:2017-03-23 09:13:11

标签: angularjs unit-testing jasmine resharper

我开始使用VS2015中的.NET 4.5解决方案,使用最新的ReSharper插件。我遵循了这个教程:

https://blogs.endjin.com/2014/09/unit-testing-angularjs-with-visual-studio-resharper-and-teamcity/

我在ReSharper的单元测试会话窗口中得到Inconclusive: Test not run

遵循本教程:

https://evanhahn.com/how-do-i-jasmine/

我可以在浏览器中运行测试页面,这两个测试都会失败,正确。

我不明白为什么当serviceSpec.js文件中的SpecRunner.html文件中的引用与///<reference path="~/bower_components/jasmine-core/lib/jasmine-core/jasmine.js"/> ///<reference path="~/bower_components/jasmine-core/lib/jasmine-core/jasmine-html.js"/> ///<reference path="~/bower_components/jasmine-core/lib/jasmine-core/boot.js"/> ///<reference path="~/bower_components/angular/angular.js"/> ///<reference path="~/bower_components/angular-mocks/angular-mocks.js"/> describe("Testum", function() { describe("Service test", function() { it('should at least run this test', function() { console.log("stuff"); expect([1, 2, 3].length).toBe(3); }); }); }); 文件中的引用相同时,ReSharper不会运行测试。

我还想知道如何从ReSharper中获取有关它在尝试运行测试时遇到的问题的更多信息。

这是我的servicesSpec.js:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Jasmine Spec Runner</title>
    <link rel="stylesheet" href="../../bower_components/jasmine-core/lib/jasmine-core/jasmine.css">
    <script src="../../bower_components/jasmine-core/lib/jasmine-core/jasmine.js"></script>
    <script src="../../bower_components/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
    <script src="../../bower_components/jasmine-core/lib/jasmine-core/boot.js"></script>
    <!-- include source files here... -->
    <!-- include spec files here... -->
    <script src="shared/orderServiceSpecs.js"></script>
</head>
<body>
</body>
</html>

这是SpecRunner.html,它在浏览器窗口中传递(我简化了测试):

/**
 * @ORM\ManyToOne(targetEntity="Liste")
 */
private $list;

0 个答案:

没有答案