-
Notifications
You must be signed in to change notification settings - Fork 17
/
test.html
46 lines (46 loc) · 1.8 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script type="text/javascript" src="../products/Utils.browser.js"></script>
<script type="text/javascript" src="../products/Particle.browser.js"></script>
<script type="text/javascript" src="../products/TestRacer.browser.js"></script>
<script type="text/javascript" src="../products/Particle.test.browser.js"></script>
<script type="text/javascript" src="../products/Path.js"></script>
<script type="text/javascript" src="../products/ParticleFileSystem.browser.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico" />
</head>
<body>
<style>
body {
font-family: "San Francisco", "Myriad Set Pro", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
white-space: pre;
font-weight: 50;
margin: auto;
max-width: 800px;
padding-top: 20px;
}
</style>
<script type="text/javascript">
const main = async () => {
const runTestMethod = new URLSearchParams(new URL(location.href).search).get("runTestMethod")
let testsToRun = testParticles
if (runTestMethod) {
testsToRun = {}
testsToRun[runTestMethod] = testParticles[runTestMethod]
}
const bodyTag = document.getElementsByTagName("body")[0]
const fileTestParticles = {}
fileTestParticles.core = testsToRun
const racer = new TestRacer(fileTestParticles).setLogFunction(message => {
const result = document.createElement("div")
result.innerHTML = message.replace(/ method (\w+)/, " method <a href='?runTestMethod=$1'>$1</a>")
bodyTag.prepend(result)
})
await racer.execute()
racer.finish()
}
main()
</script>
</body>
</html>