forked from MithrilJS/mithril.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (64 loc) · 2.04 KB
/
index.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>
<meta charset="utf-8">
<title>Mithril test suite</title>
<div id="mocha"></div>
<!-- Dependencies -->
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/sinon/pkg/sinon.js" charset="utf-8"></script>
<script src="../node_modules/sinon-chai/lib/sinon-chai.js" charset="utf-8"></script>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css">
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../test-deps/dom.js"></script>
<script src="../test-deps/mock.js"></script>
<script src="../mithril.js"></script>
<script>
mocha.setup("bdd")
var expect = chai.expect
// Temporary workaround for https://github.com/mochajs/mocha/issues/1348
chai.config.truncateThreshold = 0
</script>
<!-- Tests go here -->
<script src="./mithril.js"></script>
<script src="./mithril.mount.js"></script>
<script src="./mithril.render.js"></script>
<script src="./mithril.withAttr.js"></script>
<script src="./mithril.trust.js"></script>
<script src="./mithril.redraw.js"></script>
<script src="./mithril.route.js"></script>
<script src="./mithril.route.parseQueryString.js"></script>
<script src="./mithril.route.buildQueryString.js"></script>
<script src="./mithril.prop.js"></script>
<script src="./mithril.request.js"></script>
<script src="./mithril.deferred.js"></script>
<script src="./mithril.sync.js"></script>
<script src="./mithril.startComputation.js"></script>
<!-- Set options and run this thing -->
<script>
m.deps(mock)
mocha.checkLeaks()
mocha.globals(["m", "mochaResults"])
// For Saucelabs reporting
var runner = mocha.run()
var failedTests = []
runner.on("end", function() {
window.mochaResults = runner.stats
window.mochaResults.reports = failedTests
})
runner.on("fail", function (test, err) {
function flattenTitles(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>