grunt-contrib-jasmine/tasks/jasmine/templates/RequireJSRunner.tmpl

39 lines
1.0 KiB
Cheetah
Raw Normal View History

2012-11-29 00:52:22 +08:00
<!doctype html>
<html>
<head>
2012-11-29 00:52:22 +08:00
<meta charset="utf-8">
<title>Jasmine Spec Runner</title>
<script src="<%= options.requirejs %>"></script>
<script>
require.config({
baseUrl : '<%= options.baseUrl %>'
});
</script>
<% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
<% with (scripts) { %>
<% [].concat(jasmine, vendor, helpers).forEach(function(script){ %>
2012-11-29 00:52:22 +08:00
<script src="<%= script %>"></script>
<% }) %>
<% }; %>
<script>
require([
<% scripts.src.forEach(function(script, i){ %>
'<%= script.replace(new RegExp('^' + options.baseUrl),"").replace(/\.js$/,"") %>' <% if (i !== scripts.src.length-1){ %>,<% } %>
<% }) %>
],
function(){
require(['<%= [].concat(scripts.specs,scripts.reporters).join("','") %>'], function(){
require(['<%= scripts.start.join("','") %>'], function(){
// good to go!
})
})
}
)
</script>
</head>
<body>
</body>
</html>