-
Notifications
You must be signed in to change notification settings - Fork 163
/
RequireJsSpecRunner.htmltemplate
69 lines (60 loc) · 1.94 KB
/
RequireJsSpecRunner.htmltemplate
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
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$sourceEncoding$">
$if(autoRefresh)$
<meta http-equiv="refresh" content="$autoRefreshInterval$">
$endif$
<title>Jasmine Spec Runner</title>
<script type="application/javascript">
window.onerror = function(msg, url, line) {
var errors = window.consoleErrors = window.consoleErrors || [];
errors.push(msg + ' (' + url + ':' + line + ')');
};
function getConsoleErrors() {
var errors = [];
if (jsApiReporter && jsApiReporter.runDetails && jsApiReporter.runDetails.failedExpectations) {
errors = jsApiReporter.runDetails.failedExpectations
.map((error) => error.message + ' (' + error.filename + ':' + error.lineno + ')');
}
if (errors.length === 0) {
errors = window.consoleErrors;
}
return errors;
}
</script>
$cssDependencies$
$javascriptDependencies$
$preloadScriptTags$
</head>
<body>
<script type="application/javascript">
if(window.location.href.indexOf("SpecRunner.html") !== -1) {
document.body.appendChild(document.createTextNode("Warning: Opening this HTML file directly from the file system is deprecated. You should instead try running `mvn jasmine:bdd` from the command line, and then visit `http://localhost:8234` in your browser. "))
}
var specs = $specsList$;
var configuration = {
$if(customRunnerConfiguration)$
$customRunnerConfiguration$
$endif$
};
if (!configuration.baseUrl) {
configuration.baseUrl = '$sourceDir$';
}
if (!configuration.paths) {
configuration.paths = {};
}
if (!configuration.paths.specs) {
var specDir = '$specDir$';
if (!specDir.match(/^file/)) {
specDir = '/'+specDir;
}
configuration.paths.specs = specDir;
}
require.config(configuration);
require(specs, function() {
jasmine.boot();
});
</script>
</body>
</html>