I am trying to get the same setup as this tutorial.
First Off. My file structure is:
/assests
/css
/font
/img
/js
/collection
/lib
/model
/plugin
/spec
-> Tests in here
/view
SpecRunner.js
main.js
/templates
index.html
SpecRunner.html
My SpecRunner.html looks like:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner v2.2.0</title>
<link rel="shortcut icon" type="image/png" href="js/lib/jasmine/jasmine_favicon.png">
<link rel="stylesheet" href="js/lib/jasmine/jasmine.css">
<!--
<script type="text/javascript" src="js/lib/blanket/blanket.js"></script>
<script type="text/javascript" src="js/lib/jasmine/jasmine.js"></script>
<script type="text/javascript" src="js/lib/jasmine/jasmine-html.js"></script>
<script type="text/javascript" src="js/lib/jasmine/boot.js"></script>
<script type="text/javascript" src="js/lib/blanket/blanket_jasmine.js"></script>
-->
<script type="text/javascript" src="js/lib/require/require.js" data-main="js/SpecRunner.js">
</script>
</head>
<body>
<!--This div is to allow the views to render. It's filled with the required garbage tags-->
<div id="sandbox" style="overflow: hidden; height: 1px;">
<div id="progress-bar-container">
<div class="main_content">
</div>
</div>
</div>
</body>
</html>
My SpecRunner.js looks like:
require.config({
paths: {
'jquery' : 'lib/jqm/jquery-1.11.2.min',
'underscore' : 'lib/underscore/underscore',
'backbone' : 'lib/backbone/backbone',
//Testing Dependencies
'blanket': 'lib/blanket/blanket',
'jasmine': 'lib/jasmine/jasmine',
'jasmine-html': 'lib/jasmine/jasmine-html',
'jasmine-boot' : 'lib/jasmine/boot',
'jasmine-blanket' : 'lib/blanket/blanket_jasmine'
},
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'jasmine-boot' : {
deps : [ 'jasmine', 'jasmine-html' ],
exports : 'jasmine'
},
'jasmine-html' : {
deps : [ 'jasmine' ]
},
'jasmine-blanket' : {
deps : [ 'jasmine-boot', 'blanket' ],
exports : 'blanket'
},
}
});
require(['jquery', 'jasmine-boot', 'jasmine-blanket', 'blanket'], function($, jasmine, blanket){
blanket.options('filter', '../js/');
blanket.options('antifilter', [ '../js/lib/',
'../js/plugin/',
'../js/spec/',
'../js/SpecRunner.js',
'../js/main.js' ]);
blanket.options('branchTracking', true);
var jasmineEnv = jasmine.getEnv();
jasmineEnv.addReporter(new jasmine.BlanketReporter());
jasmineEnv.updateInterval = 1000;
var specs = [];
specs.push('../js/spec/view/DetailView');
$(document).ready(function() {
require(specs, function(spec) {
window.onload();
});
});
});
The problem is that with this current setup I get to the point where the console just displays "waiting for blanket" and hangs.
I can get a version working by removing all the blanket and jasmine dependencies from SpecRunner.js and have them in SpecRunner.html (i.e. uncomment the script references). However this version is flawed as it does not provide any blanket code coverage.
I have tried the suggestions here with no luck.
Any advice would be appreciated.