web3.js/test/utils.isString.js

23 lines
634 B
JavaScript
Raw Normal View History

2015-03-08 09:07:32 +00:00
var chai = require('chai');
2015-03-08 17:18:52 +00:00
var utils = require('../lib/utils/utils.js');
2015-03-08 09:07:32 +00:00
var assert = chai.assert;
var tests = [
{ value: function () {}, is: false},
{ value: new Function(), is: false},
{ value: 'function', is: true},
{ value: {}, is: false},
{ value: new String('hello'), is: true}
];
2015-03-25 21:17:35 +00:00
describe('lib/utils/utils', function () {
2015-03-08 09:07:32 +00:00
describe('isString', function () {
tests.forEach(function (test) {
it('shoud test if value ' + test.func + ' is string: ' + test.is, function () {
assert.equal(utils.isString(test.value), test.is);
});
});
});
});