Updated example.html to use TrivialReporter

This commit is contained in:
ragaskar 2009-06-20 20:01:03 -07:00
parent 280c7bcf27
commit c420c78517
2 changed files with 48 additions and 19 deletions

View File

@ -1,24 +1,49 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>Jasmine Example</title> <title>Jasmine Test Runner</title>
<script type="text/javascript" src="../lib/jasmine.js"></script>
<script type="text/javascript" src="example.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/jasmine.css"/>
</head> </head>
<body> <script type="text/javascript" src="../spec/lib/json2.js"></script>
<h1> <script type="text/javascript" src="../lib/jasmine.js"></script>
Running Jasmine Example Specs <script type="text/javascript" src="../lib/TrivialReporter.js"></script>
</h1>
<div id="results"></div>
<script type="text/javascript"> <script type="text/javascript">
jasmine.getEnv().execute(); jasmine.include('example.js', true);
setTimeout(function () {
document.getElementById('results').innerHTML = 'It\'s alive! :' +
(jasmine.getEnv().currentRunner.getResults().passedCount === 1);
}, 250);
</script> </script>
<style type="text/css">
.spec {
margin: 5px;
}
.passed {
background-color: lightgreen;
}
.failed {
background-color: pink;
}
.resultMessage {
white-space: pre;
}
.stackTrace {
white-space: pre;
font-size: .8em;
margin-left: 10px;
}
</style>
<body>
<script type="text/javascript">
var jasmineEnv = jasmine.getEnv();
jasmineEnv.reporter = new jasmine.TrivialReporter();
jasmineEnv.execute();
</script>
</body> </body>
</html> </html>

View File

@ -1,7 +1,11 @@
describe('one suite description', function () { describe('ExampleSuite', function () {
it('should be a test', function() { it('should have a passing test', function() {
runs(function () {
expect(true).toEqual(true); expect(true).toEqual(true);
}); });
describe('Nested Describe', function () {
it('should also have a passing test', function () {
expect(true).toEqual(true);
});
}); });
}); });