[Pkg-javascript-commits] [node-async] 211/480: Add test for exposed memoized memos (3405799)

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:27 UTC 2014


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

js pushed a commit to branch master
in repository node-async.

commit 879d3670213e7fe06b885cb4b08ce287a4d7eb6e
Author: Parsha Pourkhomami <parshap+git at gmail.com>
Date:   Sat Sep 1 13:10:47 2012 -0700

    Add test for exposed memoized memos (3405799)
---
 test/test-async.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/test-async.js b/test/test-async.js
index 52f5536..789d0f6 100644
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -1503,6 +1503,18 @@ exports['memoize custom hash function'] = function (test) {
     test.done();
 };
 
+exports['memoize manually added memo value'] = function (test) {
+    test.expect(1);
+    var fn = async.memoize(function(arg, callback) {
+        test(false, "Function should never be called");
+    });
+    fn.memo["foo"] = ["bar"];
+    fn("foo", function(val) {
+        test.equal(val, "bar");
+        test.done();
+    });
+};
+
 // Issue 10 on github: https://github.com/caolan/async/issues#issue/10
 exports['falsy return values in series'] = function (test) {
     function taskFalse(callback) {

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



More information about the Pkg-javascript-commits mailing list