Updated example.html to use TrivialReporter
This commit is contained in:
parent
280c7bcf27
commit
c420c78517
@ -2,23 +2,48 @@
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Jasmine Example</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"/>
|
||||
<title>Jasmine Test Runner</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
Running Jasmine Example Specs
|
||||
</h1>
|
||||
<div id="results"></div>
|
||||
<script type="text/javascript" src="../spec/lib/json2.js"></script>
|
||||
<script type="text/javascript" src="../lib/jasmine.js"></script>
|
||||
<script type="text/javascript" src="../lib/TrivialReporter.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jasmine.getEnv().execute();
|
||||
setTimeout(function () {
|
||||
document.getElementById('results').innerHTML = 'It\'s alive! :' +
|
||||
(jasmine.getEnv().currentRunner.getResults().passedCount === 1);
|
||||
}, 250);
|
||||
jasmine.include('example.js', true);
|
||||
</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>
|
||||
</html>
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
describe('one suite description', function () {
|
||||
it('should be a test', function() {
|
||||
runs(function () {
|
||||
describe('ExampleSuite', function () {
|
||||
it('should have a passing test', function() {
|
||||
expect(true).toEqual(true);
|
||||
});
|
||||
|
||||
describe('Nested Describe', function () {
|
||||
it('should also have a passing test', function () {
|
||||
expect(true).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user