Uncluttered/mochaChai.html

41 lines
1.0 KiB
HTML
Raw Normal View History

2023-11-26 21:36:58 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Mocha Tests</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/test-utils/mocha.css" />
<!--
<script type="importmap">
{
"imports": {
}
}
</script>
-->
</head>
<body>
<div id="mocha"></div>
2023-11-26 21:43:18 +01:00
<script src="/test-utils/chai.js"></script>
<script src="/test-utils/mocha.js"></script>
2023-11-26 21:36:58 +01:00
<script class="mocha-init" type="module">
2023-11-26 21:43:18 +01:00
mocha.setup({ ui: "tdd", timeout: "2000"})
mocha.checkLeaks()
window.addEventListener("load", function loaded () {
2023-11-26 21:36:58 +01:00
// Callback so that the test results get reported to CI
2023-11-26 21:43:18 +01:00
mocha.run(function mochaRan (failures) {
2023-11-26 21:36:58 +01:00
window._testResults = {
done: true,
failures,
succeeded: failures ? false : true,
}
})
})
</script>
<!-- Include the test files as script elements. -->
<!-- <script src="/path/to/file.js" type="module"></script> -->
</body>
</html>