Skip to content

Instantly share code, notes, and snippets.

@mattd
Created December 18, 2012 17:30
Show Gist options
  • Save mattd/4330027 to your computer and use it in GitHub Desktop.
Save mattd/4330027 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner</title>
<script data-main="./<%= options.requireConfig.config %>" src="<%= options.requireConfig.requirejs %>"></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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment