node_tests/dispatch.js: Stub blueslip module.

Stub the blueslip module to print a nicely formatted traceback.
Earlier the traceback used to be only a `ReferenceError` because
blueslip was not stubbed.

Fixes: #4021.
This commit is contained in:
Harshit Bansal 2017-03-11 19:27:54 +00:00 committed by Tim Abbott
parent b13b660709
commit c6cf025ee9
1 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,19 @@ set_global('pointer', {});
// We access various msg_list object to rerender them // We access various msg_list object to rerender them
set_global('current_msg_list', {rerender: noop}); set_global('current_msg_list', {rerender: noop});
// We use blueslip to print the traceback
set_global('blueslip', {
error: function (msg, more_info, stack) {
console.log("\nFailed to process an event:\n", more_info.event, "\n");
var error = new Error();
error.stack = stack;
throw error;
},
exception_msg: function (ex) {
return ex.message;
},
});
var server_events = require('js/server_events.js'); var server_events = require('js/server_events.js');
// This also goes away if we can isolate the dispatcher. We // This also goes away if we can isolate the dispatcher. We