node tests: Use zrequire in bot_data.js.

This commit is contained in:
Steve Howell
2017-11-08 07:53:44 -08:00
committed by Tim Abbott
parent 640b0d5653
commit e63dd59065

View File

@@ -1,8 +1,9 @@
add_dependencies({
people: 'js/people.js',
});
var patched_underscore = _.clone(_);
patched_underscore.debounce = function (f) { return f; };
global.patch_builtin('_', patched_underscore);
var _ = global._;
zrequire('people');
zrequire('bot_data');
set_global('$', function (f) {
if (f) {
@@ -26,13 +27,6 @@ global.people.add({
global.people.initialize_current_user(42);
var patched_underscore = _.clone(_);
patched_underscore.debounce = function (f) { return f; };
global.patch_builtin('_', patched_underscore);
var bot_data = require('js/bot_data.js');
bot_data.initialize();
// Our startup logic should have added Bot 0 from page_params.
assert.equal(bot_data.get('bot0@zulip.com').full_name, 'Bot 0');