1 var Parser = require('../lib/parser/hiredis').Parser;
2 var assert = require('assert');
5 This test makes sure that exceptions thrown inside of "reply" event handlers
6 are not trapped and mistakenly emitted as parse errors.
8 (function testExecuteDoesNotCatchReplyCallbackExceptions() {
9 var parser = new Parser();
15 return replies.shift();
19 var emittedError = false;
20 var caughtException = false;
23 .on('error', function() {
26 .on('reply', function() {
27 throw new Error('bad');
33 caughtException = true;
36 assert.equal(caughtException, true);
37 assert.equal(emittedError, false);