[Pkg-javascript-commits] [node-hash-base] 01/02: Update should return hash instance

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:21:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to annotated tag v1.0.2
in repository node-hash-base.

commit 59fef2bc3b417aac5563022bcc928d1ae8161ee9
Author: Kirill Fomichev <fanatid at ya.ru>
Date:   Mon Apr 4 14:11:06 2016 +0300

    Update should return hash instance
---
 index.js      | 1 +
 test/index.js | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/index.js b/index.js
index 5e9f15f..5599960 100644
--- a/index.js
+++ b/index.js
@@ -19,6 +19,7 @@ HashBase.prototype.update = function (data, encoding) {
   }
 
   this._update(data)
+  return this
 }
 
 HashBase.prototype.digest = function (encoding) {
diff --git a/test/index.js b/test/index.js
index b7177e3..8175cf0 100644
--- a/test/index.js
+++ b/test/index.js
@@ -45,6 +45,12 @@ test('update', function (t) {
     t.end()
   })
 
+  t.test('should return hash instance', function (t) {
+    t.base._update = function () {}
+    t.same(t.base.update(new Buffer(42)), t.base)
+    t.end()
+  })
+
   t.end()
 })
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-hash-base.git



More information about the Pkg-javascript-commits mailing list