mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
* added sub packages * added lerna monopackage management * check for package is instance * added method, subscription and utils package * moved almost all packages * moved all packages, no umbrella package yet * added extend to packages * made contract pass * made batch tests pass * expose providers * fixed test async * fixed test errors * fixed test event encode decode * fixed test formatter tests * fixed method tests * fixed method utils * fixed some eth methods * fixed some eth methods 2 * bumped version 0.18.3 to republish meteor package * fixed get* tests * fixed subscribe tests * added newBlockHeaders subscription * remove unpublished package from package.json * added sendTransaction test * fixed call test * moved files to done * changed extend * added iban tests * Fixed ALL tests * Fixed lint tests * Fixed contract tests * added method tests * added more method tests to test promiEvents extensively * added confirmation event * improved method confirmation checking
25 lines
733 B
JavaScript
25 lines
733 B
JavaScript
var chai = require('chai');
|
|
var utils = require('../packages/web3-utils');
|
|
|
|
var assert = chai.assert;
|
|
|
|
var tests = [
|
|
{ value: function () {}, is: false},
|
|
{ value: new Function(), is: false},
|
|
{ value: 'function', is: false},
|
|
{ value: {}, is: false},
|
|
{ value: '0xc6d9d2cd449a754c494264e1809c50e34d64562b', is: true },
|
|
{ value: 'c6d9d2cd449a754c494264e1809c50e34d64562b', is: true }
|
|
];
|
|
|
|
describe('lib/utils/utils', function () {
|
|
describe('isAddress', function () {
|
|
tests.forEach(function (test) {
|
|
it('shoud test if value ' + test.value + ' is address: ' + test.is, function () {
|
|
assert.equal(utils.isAddress(test.value), test.is);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|