forked from prateekbh/veronica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.html
73 lines (64 loc) · 1.9 KB
/
tests.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
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Consumer Site </title>
<link rel="stylesheet" href="css/mocha.css" type="text/css" />
<style>
body {}
</style>
</head>
<body>
<quick-view>
<div class="container"></div>
</quick-view>
<quick-cartmanager></quick-cartmanager>
<div id="mocha"></div>
<!-- mocha -->
<script src="js/vendor/mocha.js"></script>
<script src="js/vendor/chai.js"></script>
<script src="js/vendor/simulant.js"></script>
<script>
mocha.setup('bdd');
// Setup chai
var assert = chai.assert,
should = chai.should,
expect = chai.expect;
</script>
<script src="../veronica.js"></script>
<script src="./tags/tags.js"></script>
<script src="js/tests.js"></script>
<!-- run mocha -->
<script>
window.onload = function() {
var runner;
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
var failedTests = [];
runner.on('end', function() {
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
});
runner.on('fail', logFailure);
function logFailure(test, err) {
var flattenTitles = function(test) {
var titles = [];
while (test.parent.title) {
titles.push(test.parent.title);
test = test.parent;
}
return titles.reverse();
};
failedTests.push({
name: test.title,
result: false,
message: err.message,
stack: err.stack,
titles: flattenTitles(test)
});
}
}
};
</script>
</body>
</html>