diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-09 02:35:32 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-09 02:35:32 +0800 |
commit | 5518022a5d153ef514338edcb427a90ad066d064 (patch) | |
tree | a6ae2ab269a1063b27f381fbf9acc2517c1ad2cc | |
parent | 807ec60e63e54f648bea47037c307b63d1bc6c04 (diff) | |
download | go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.tar go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.tar.gz go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.tar.bz2 go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.tar.lz go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.tar.xz go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.tar.zst go-tangerine-5518022a5d153ef514338edcb427a90ad066d064.zip |
mocha test init
-rw-r--r-- | test/methods.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/methods.js b/test/methods.js new file mode 100644 index 000000000..54d96b486 --- /dev/null +++ b/test/methods.js @@ -0,0 +1,49 @@ +require('es6-promise').polyfill(); + +var assert = require('assert'); +var web3 = require('../index.js'); +web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080')); // TODO: create some mock provider + +var methodExists = function (object, method) { + assert.equal('function', typeof object[method], 'method ' + method + ' is not implemented'); +}; + +var propertyExists = function (object, property) { + assert.equal('object', typeof object[property], 'property ' + property + ' is not implemented'); +}; + +describe('web3', function() { + describe('eth', function() { + it('should have all methods implemented', function() { + methodExists(web3.eth, 'balanceAt'); + methodExists(web3.eth, 'stateAt'); + methodExists(web3.eth, 'storageAt'); + methodExists(web3.eth, 'countAt'); + methodExists(web3.eth, 'codeAt'); + methodExists(web3.eth, 'transact'); + methodExists(web3.eth, 'call'); + methodExists(web3.eth, 'block'); + methodExists(web3.eth, 'transaction'); + methodExists(web3.eth, 'uncle'); + methodExists(web3.eth, 'compilers'); + methodExists(web3.eth, 'lll'); + methodExists(web3.eth, 'solidity'); + methodExists(web3.eth, 'serpent'); + methodExists(web3.eth, 'logs'); + }); + + it('should have all properties implemented', function () { + propertyExists(web3.eth, 'coinbase'); + propertyExists(web3.eth, 'listening'); + propertyExists(web3.eth, 'mining'); + propertyExists(web3.eth, 'gasPrice'); + propertyExists(web3.eth, 'account'); + propertyExists(web3.eth, 'accounts'); + propertyExists(web3.eth, 'peerCount'); + propertyExists(web3.eth, 'defaultBlock'); + propertyExists(web3.eth, 'number'); + }); + }); +}) + + |