pull/2/head
Louis Chatriot 11 years ago
parent 69f31fe3e5
commit 70c4daf920
  1. 2
      test/db.test.js

@ -227,7 +227,7 @@ describe('Database', function () {
* *
* So we need a way to check that the callback is called only once and the exception thrown is indeed the client exception * So we need a way to check that the callback is called only once and the exception thrown is indeed the client exception
* Mocha's exception handling mechanism interferes with this since it already registers a listener on uncaughtException * Mocha's exception handling mechanism interferes with this since it already registers a listener on uncaughtException
* which we need to use since findOne uses I/O so the callback is not called in the same turn of the event loop (so no try/catch) * which we need to use since findOne is not called in the same turn of the event loop (so no try/catch)
* So we remove all current listeners, put our own which when called will register the former listeners (incl. Mocha's) again. * So we remove all current listeners, put our own which when called will register the former listeners (incl. Mocha's) again.
* *
* Note: maybe using an in-memory only NeDB would give us an easier solution * Note: maybe using an in-memory only NeDB would give us an easier solution

Loading…
Cancel
Save