[Pkg-javascript-commits] [node-leveldown] 144/492: test against console.error() call

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:53 UTC 2014


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

andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.

commit 59a5fd4ba6fdbc58e52c66563966c2f8f2fbc780
Author: Rod Vagg <rod at vagg.org>
Date:   Tue Jan 1 20:14:44 2013 +1100

    test against console.error() call
---
 test/deferred-open-test.js | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/test/deferred-open-test.js b/test/deferred-open-test.js
index e6bd34b..833e193 100644
--- a/test/deferred-open-test.js
+++ b/test/deferred-open-test.js
@@ -98,24 +98,26 @@ buster.testCase('Deferred open()', {
     
     
   , 'maxListeners warning': function (done) {
-        var location = common.nextLocation()
-        // 1) open database without callback, opens in worker thread
-          , db       = levelup(location, { createIfMissing: true, errorIfExists: true, encoding: 'utf8' })
+      var location   = common.nextLocation()
+      // 1) open database without callback, opens in worker thread
+        , db         = levelup(location, { createIfMissing: true, errorIfExists: true, encoding: 'utf8' })
+        , stderrMock = this.mock(console)
 
-        this.closeableDatabases.push(db)
-        this.cleanupDirs.push(location)
+      this.closeableDatabases.push(db)
+      this.cleanupDirs.push(location)
+      stderrMock.expects('error').never()
 
-        // 2) provoke an EventEmitter maxListeners warning
-        var toPut = 11
-        
-        for (var i = 0; i < toPut; i++) {
-          db.put('some', 'string', function (err) {
-            refute(err)
-            
-            if (!--toPut) {
-              done()
-            }
-          })
-        }
+      // 2) provoke an EventEmitter maxListeners warning
+      var toPut = 11
+
+      for (var i = 0; i < toPut; i++) {
+        db.put('some', 'string', function (err) {
+          refute(err)
+
+          if (!--toPut) {
+            done()
+          }
+        })
       }
+    }
 })
\ No newline at end of file

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



More information about the Pkg-javascript-commits mailing list