I'm just starting to use Jasmine in Visual Studio with R#. To make it work I have to add these lines to the top of the spec file:
///<reference path="../jasmine/jasmine.js"/>
///<reference path="../jasmine/jasmine-html.js"/>
///<reference path="../jasmine/boot.js"/>
However, when I run the test, the file opened in the browser contains the references in the header in another order (and strange indentation):
<script type="text/javascript" src="referenceFile?path=~/Project/Scripts/jasmine/jasmine-html.js"></script>
<script type="text/javascript" src="referenceFile?path=~/Project/Scripts/jasmine/boot.js"></script>
<script type="text/javascript" src="referenceFile?path=~/Project/Scripts/jasmine/jasmine.js"></script>
The problem is that boot.js
needs to come last, otherwise it doesn't work. Is it possible to fix this? Maybe there is a workaround if this is just R# behaviour.
答案 0 :(得分:1)
ReSharperRunner.html
文件添加到项目中; Copy default implementation to clipboard
此处ReSharper | Options | Tools | Unit Testing | JavaScript Tests | Custom HTML harness
并将代码粘贴到那里; ReSharper | Options | Tools | Unit Testing | JavaScript Tests | Enable custom HTML harness | Test harness file name
Test harness location
组合框。