Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Add test for obsolete (?) toArray
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jan 5, 2018
1 parent d22539c commit 1ec8717
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,10 @@ describe('toBuffer', function () {
assert.deepEqual(ethUtils.toBuffer(null), Buffer.allocUnsafe(0))
// undefined
assert.deepEqual(ethUtils.toBuffer(), Buffer.allocUnsafe(0))
// 'toArray'
// 'toBN'
assert.deepEqual(ethUtils.toBuffer(new BN(1)), Buffer.from([1]))
// 'toArray'
assert.deepEqual(ethUtils.toBuffer({ toArray: function () { return [ 1 ] } }), Buffer.from([1]))
})
it('should fail', function () {
assert.throws(function () {
Expand Down

0 comments on commit 1ec8717

Please sign in to comment.