-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpecRunner.html
61 lines (46 loc) · 1.84 KB
/
SpecRunner.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Ally Charts: Jasmine Test Runner</title>
<link rel="stylesheet" type="text/css" href="globals/jasmine/jasmine.css">
<script type="text/javascript" src="globals/jasmine/jasmine.js"></script>
<script type="text/javascript" src="globals/jasmine/jasmine-html.js"></script>
<!-- include source files here... -->
<script src="globals/jquery-1.6.js" type="text/javascript" charset="utf-8"></script>
<script src="globals/jquery-ui-1.8.custom.js" type="text/javascript" charset="utf-8"></script>
<!-- include spec files here... -->
<script type="text/javascript" src="globals/require.js"></script>
</head>
<body>
<script type="text/javascript">
(function () {
var HrefFixReporter = function () {};
HrefFixReporter.prototype = $.extend({}, jasmine.Reporter);
HrefFixReporter.prototype.reportRunnerResults = function () {
$('a').each(
function () {
this.href = this.href.replace('?', '?module=' + module + '&');
}
);
};
var matches = window.location.search.match(/[?&]module=([^&]+)/);
var module = matches && matches.length > 1 && matches[1];
if (module) {
require({ urlArgs: "bust=" + (new Date()).getTime()}, ['specs/' + module], function () {
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
jasmine.getEnv().addReporter(new HrefFixReporter());
jasmine.getEnv().execute();
$('a').each(function () {
this.href = this.href.replace('?', '?module=' + module + '&');
});
});
} else {
$(function () {
$('body').append('<h1>Any requests?</h1><p>Add the name of the spec module to the querystring, e.g. <code>?module=example-spec</code> to run <code>specs/interest-table-spec.js</code>.');
})
}
}());
</script>
</body>
</html>