test: refactor index.html to include mocha setup as an external script

This was done so the sister webpack build can use the same mocha setup script
This commit is contained in:
Ben Heidemann 2021-03-21 13:37:45 +00:00
parent e3b9c5758f
commit 3e2f780330
2 changed files with 9 additions and 8 deletions

View File

@ -11,14 +11,7 @@
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script>
mocha.setup('bdd').timeout(10000).slow(250);
window.onload = function() {
mocha.checkLeaks();
mocha.run();
};
</script>
<script src="./setup-mocha.js"></script>
<!-- Add any new tests to `tests/index.js` -->
<script src="./index.js"></script>

8
tests/setup-mocha.js Normal file
View File

@ -0,0 +1,8 @@
var mocha = require('mocha');
mocha.setup('bdd').timeout(10000).slow(250);
window.onload = function() {
mocha.checkLeaks();
mocha.run();
};