web3.js/test/helpers/test.utils.js

24 lines
721 B
JavaScript
Raw Normal View History

2015-03-23 22:10:18 +00:00
var chai = require('chai');
var assert = chai.assert;
var web3 = require('../../index');
var methodExists = function (object, method) {
it('should have method ' + method + ' implemented', function() {
2015-03-23 07:37:41 +00:00
web3.setProvider(null);
assert.equal('function', typeof object[method], 'method ' + method + ' is not implemented');
});
};
var propertyExists = function (object, property) {
it('should have property ' + property + ' implemented', function() {
2015-03-23 07:37:41 +00:00
web3.setProvider(null);
assert.notEqual('undefined', typeof object[property], 'property ' + property + ' is not implemented');
});
};
module.exports = {
methodExists: methodExists,
propertyExists: propertyExists
};