Windows 7 で JScover 0.2.0 をセットアップして、ページhttp://localhost:8080/jscoverage.html
にアクセスできるようにしました。たとえば、テスト カバレッジが機能していることを確認できます。
私が JSCover for staters で実行しようとしている Jasmine テストは、私のプロジェクトのフォルダーにある'jasmine-ObjectTreeStructure-Tests.js'
ファイルです。/OnTheMoveWebFiles/js
Jasmine の他のライブラリとテスト ファイルはすべて、この同じフォルダーにあります。
私は通常、プロジェクトをデバッグ モードで実行してからhttp://localhost:57263/FeatureDev/JavaScriptTestsWithDependencies.aspx
.
このページには、jasmine、jquery などの依存関係と、テストが必要な多くの jasmine test .js ファイルが含まれています。コード カバレッジをチェックできるよう
に、JSOver をファイルに統合するにはどうすればよいですか。は非常に基本的です。JavaScriptTestsWithDependencies.aspx
JavaScriptTestsWithDependencies.aspx
<script type="text/javascript">
(function () {
"use strict";
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 250;
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function (spec) {
return htmlReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function () {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
追加して、反転モード で JSCover を実行しようとしましたwindow.open('path/to/jscoverage.html');
window.open('http://localhost:8080/jscoverage.html');
function execJasmine() {
jasmineEnv.execute();
}
execJasmine メソッドの直前ですが、空の URL を含むポップアップで jscoverage.html しか開かれませんでした。
質問: JSCover をこれにプラグインする場所と方法は?