From c397e350f4903b13af901762547fcc4d7905d8cd Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 8 Jan 2015 20:24:30 +0100 Subject: [PATCH] mocha opts file && init of parser tests --- lib/abi.js | 1 + test/abi.parsers.js | 37 +++++++++++++++++++++++++++++++++++++ test/mocha.opts | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 test/abi.parsers.js create mode 100644 test/mocha.opts diff --git a/lib/abi.js b/lib/abi.js index 5a4d645158..e37f477ee0 100644 --- a/lib/abi.js +++ b/lib/abi.js @@ -263,3 +263,4 @@ module.exports = { inputParser: inputParser, outputParser: outputParser }; + diff --git a/test/abi.parsers.js b/test/abi.parsers.js new file mode 100644 index 0000000000..06a77fb866 --- /dev/null +++ b/test/abi.parsers.js @@ -0,0 +1,37 @@ +var assert = require('assert'); +var abi = require('../lib/abi.js'); + +describe('abi', function() { + describe('inputParser', function() { + it('should parse ...', function() { + + var desc = [{ + "name": "multiply", + "inputs": [ + { + "name": "a", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "d", + "type": "uint256" + } + ] + }]; + + var iParser = abi.inputParser(desc); + assert.equal(iParser.multiply(1), "0x000000000000000000000000000000000000000000000000000000000000000001"); + + }); + }); + + + describe('outputParser', function() { + it('parse ...', function() { + + }); + }); +}); + diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000000..b83917bb2f --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,2 @@ +--reporter Nyan +