ethers.js/tests/test.html
2018-06-03 02:42:53 -04:00

64 lines
1.9 KiB
HTML

<!doctype html>
<html>
<head>
<title>Ethers Test Suite</title>
<meta charset="UTF-8">
<link href="../node_modules/mocha/mocha.css" rel="stylesheet" />
<style type="text/css">
</style>
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<!--
Shim for PhantomJS: Promise
See: https://github.com/stefanpenner/es6-promise
-->
<script src="./dist/es6-promise.auto.js"></script>
<!--
Shims for PhantomJS
-->
<script type="text/javascript">
// ArrayBuffer.isView
if (!ArrayBuffer.isView) {
ArrayBuffer.isView = function(obj) {
// @TODO: This should probably check various instanceof aswell
return !!(obj.buffer);
}
}
// nextTick
if (!window.nextTick) {
window.nextTick = function (callback) { setTimeout(callback, 0); }
}
// https://github.com/nathanboktae/mocha-phantomjs-core#usage
if (typeof(initMochaPhantomJS) === 'function') {
initMochaPhantomJS();
}
</script>
<!-- Inject the mocha describe and it functions -->
<script type="text/javascript">mocha.setup('bdd')</script>
<!-- Load the browser dist ethers package -->
<script type="text/javascript" src="../dist/ethers.js"></script>
<!-- Our test cases; compiled by browserify -->
<script src="./dist/tests.js" type="text/javascript"></script>
<!-- Run the test cases! -->
<script type="text/javascript">
// Use this to focus on specific test cases
//mocha.grep(new RegExp('Test Brain Wallets')).run();
mocha.run();
</script>
</body>
</html>