Created
July 24, 2012 17:45
-
-
Save keithelliott/3171434 to your computer and use it in GitHub Desktop.
Example Jasmine SpecRunner html file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Jasmine Spec Runner</title> | |
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.2.0/jasmine_favicon.png"> | |
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css"> | |
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script> | |
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script> | |
<!-- include source files here... --> | |
<script type="text/javascript" src="src/Player.js"></script> | |
<script type="text/javascript" src="src/Song.js"></script> | |
<!-- include spec files here... --> | |
<script type="text/javascript" src="spec/SpecHelper.js"></script> | |
<script type="text/javascript" src="spec/PlayerSpec.js"></script> | |
<script type="text/javascript"> | |
(function() { | |
var jasmineEnv = jasmine.getEnv(); | |
jasmineEnv.updateInterval = 1000; | |
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> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With Jasmine >= 2 you must load
boot.js
afterjasmine-html.js
, but you can skip the inline script at line 19-46.See "Jasmine Default Setup" in this example.