Skip to content

Instantly share code, notes, and snippets.

@OakRaven
Created May 6, 2012 16:46
Show Gist options
  • Save OakRaven/2623232 to your computer and use it in GitHub Desktop.
Save OakRaven/2623232 to your computer and use it in GitHub Desktop.
Jasmine SpecRunner
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Jasmine Spec Runner</title>
<link rel="stylesheet" type="text/css" href="spec/jasmine/jasmine.css">
<script src="spec/jasmine/jasmine.js"></script>
<script src="spec/jasmine/jasmine-html.js"></script>
<!-- include source files here... -->
<script src="js/calculator.js"></script>
<!-- include spec files here... -->
<script src="spec/calculatorSpec.js"></script>
</head>
<body>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment