-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
55 lines (51 loc) · 1.79 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
<!DOCTYPE html>
<html>
<head>
<title>Exercises</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script>
// // TODO: (Optional) link up data for browser tests
// getData()
// function getData() {
// return fetch('data/person-1.json')
// .then(res => res.json())
// .then(data => {
// window.lukeSkywalker = data
// })
// }
</script>
<script>
window.showInstallMessage = function showInstallMessage() {
const msg = 'ERROR: Expected modules failed to load (chai, mocha)!!!\n\nHOW TO FIX: Run `npm install` in terminal from this project\'s folder.'
showInstallMessage.count = showInstallMessage.count ? showInstallMessage.count++ : 1
if (showInstallMessage.count >= 1) return console.error(msg)
alert(msg)
}
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/6.2.0/mocha.min.css" onerror="showInstallMessage()" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/6.2.0/mocha.min.js" onerror="showInstallMessage()"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js" onerror="showInstallMessage()"></script>
<script>
mocha.setup('bdd')
chai.config.includeStack = true
var expect = chai.expect
</script>
<style>
body {
zoom: 1.75;
}
#mocha .test h2 {
text-decoration: underline;
}
</style>
</head>
<body onload="mocha.run()">
<div id="mocha"></div>
<!-- load code you want to test here -->
<script src="index.js"></script>
<!-- load your test files here -->
<script src="test/index.test.js"></script>
</body>
</html>