Added browser test harness.

This commit is contained in:
ricmoo 2017-02-27 01:51:27 -05:00
parent 90f27da293
commit ebd9bbde2e
3 changed files with 30 additions and 0 deletions

View File

@ -101,6 +101,7 @@ module.exports = function(grunt) {
'dist/ethers-providers.js': './providers/index.js',
'dist/ethers-utils.js': './utils/index.js',
'dist/ethers-wallet.js': './wallet/index.js',
'dist/ethers-tests.js': './tests/browser.js',
},
options: {
transform: [

8
tests/browser.js Normal file
View File

@ -0,0 +1,8 @@
'use strict';
module.exports = {
"contract-interface": require('./run-contract-interface.js'),
"hdnode": require('./run-hdnode.js'),
"utils": require('./run-utils.js'),
"wallet": require('./run-wallet.js'),
};

21
tests/test.html Normal file
View File

@ -0,0 +1,21 @@
<!doctype html>
<html>
<head>
<title>Example Test Suite</title>
<meta charset="UTF-8">
<style type="text/css">
ol {
display: block;
}
</style>
<script src="./node_modules/nodeunit/examples/browser/nodeunit.js"></script>
<script src="../dist/ethers-tests.js"></script>
</head>
<body>
<h1 id="nodeunit-header">Example Test Suite</h1>
<script>
nodeunit.run(ethers);
</script>
</body>
</html>