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

41 lines
1.3 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>
<% if (options.requireConfig) { %>
require.config(<%= JSON.stringify(options.requireConfig) %>);
<% } %>
</script>
<% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
<% with (scripts) { %>
<% [].concat(jasmine, vendor, helpers).forEach(function(script){ %>
<script src="<%= script %>"></script>
<% }) %>
<% }; %>
<script>
require([
<% scripts.src.forEach(function(script, i){ %>
<% if (options.requireConfig && options.requireConfig.baseUrl) script = script.replace(new RegExp('^' + options.requireConfig.baseUrl),""); %>
<% if (options.loaderPlugin) script = options.loaderPlugin + '!' + script %>
'<%= script.replace(/\.js$/,"") %>' <%= i < scripts.src.length-1 ? ',' : '' %>
<% }) %>
],
function(){
require(['<%= [].concat(scripts.specs,scripts.reporters).join("','") %>'], function(){
require(['<%= scripts.start.join("','") %>'], function(){
// good to go! Our tests should already be running.
})
})
}
)
</script>
</head>
<body>
</body>
</html>