mirror of
https://github.com/jimeh/node-base58.git
synced 2026-02-19 07:36:40 +00:00
added tests
This commit is contained in:
@@ -63,6 +63,26 @@ describe('Base58', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('when passed a negative number', function () {
|
||||||
|
it('throws an error', function () {
|
||||||
|
assert.throws(function () {
|
||||||
|
base58.encode(-300);
|
||||||
|
}, function (err) {
|
||||||
|
return err.message === 'Value passed is not a non-negative safe integer.';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when passed a non-safe integer', function () {
|
||||||
|
it('throws an error', function () {
|
||||||
|
assert.throws(function () {
|
||||||
|
base58.encode(1E100);
|
||||||
|
}, function (err) {
|
||||||
|
return err.message === 'Value passed is not a non-negative safe integer.';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.decode', function () {
|
describe('.decode', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user