/
mocha.html
58 lines (52 loc) · 1.61 KB
/
mocha.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Mocha Tests</title>
@@TestFrameworkDependencies@@
<script type="text/javascript">
mocha.setup('@@MochaUi@@');
</script>
@@CodeCoverageDependencies@@
@@ReferencedCSSFiles@@
@@ReferencedJSFiles@@
@@TestJSFile@@
</head>
<body>
@@TestHtmlTemplateFiles@@
<div id="mocha"></div>
<script type="text/javascript">
var requireExists = window.require && typeof window.require === "function";
var amdTestPaths = [@@AMDTestPath@@];
if (requireExists && amdTestPaths.length > 0) {
if (window.chutzpah) {
console.log("!!_!! Test file is using module loader.");
window.chutzpah.usingModuleLoader = true;
}
require.config({
map: {
'*': {
@@AMDModuleMap@@
}
}
});
window.require(amdTestPaths, function () {
mocha.run();
});
} else {
if (window._Chutzpah_covobj_name) {
blanket.options("existingRequireJS", false);
}
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
if (!window._Chutzpah_covobj_name || requireExists) {
mocha.run();
}
};
}
</script>
</body>
</html>