simplify tests and add console.log for debugging

This commit is contained in:
Matteo Pagliazzi
2016-05-26 21:54:26 +02:00
parent 8292903444
commit 3c338ddcd7
4 changed files with 7 additions and 3 deletions

View File

@@ -20,7 +20,9 @@ angular.module('habitrpg')
// Something has changed on the user object that was not tracked here, sync the user // Something has changed on the user object that was not tracked here, sync the user
if (isNotSync && ($rootScope.User.user._v - oldUserV) > 1) { if (isNotSync && ($rootScope.User.user._v - oldUserV) > 1) {
console.log('before sync', Date.now())
$rootScope.User.sync(); $rootScope.User.sync();
console.log('after sync', Date.now())
} }
} }
} }

View File

@@ -47,11 +47,11 @@ describe('cron middleware', () => {
it('calls next when user is not attached', (done) => { it('calls next when user is not attached', (done) => {
res.locals.user = null; res.locals.user = null;
cronMiddleware(req, res, (err) => done(err)); cronMiddleware(req, res, done);
}); });
it('calls next when days have not been missed', (done) => { it('calls next when days have not been missed', (done) => {
cronMiddleware(req, res, (err) => done(err)); cronMiddleware(req, res, done);
}); });
it('should clear todos older than 30 days for free users', async (done) => { it('should clear todos older than 30 days for free users', async (done) => {

View File

@@ -82,7 +82,9 @@ angular.module('habitrpg')
.then(function (response) { .then(function (response) {
if (response.data.message) Notification.text(response.data.message); if (response.data.message) Notification.text(response.data.message);
console.log('before extend', Date.now())
_.extend(user, response.data.data); _.extend(user, response.data.data);
console.log('after extend', Date.now())
$rootScope.$emit('userUpdated', user); $rootScope.$emit('userUpdated', user);

View File

@@ -355,7 +355,7 @@ api.transferGems = {
receiverName: receiver.profile.name, receiverName: receiver.profile.name,
senderName: sender.profile.name, senderName: sender.profile.name,
}); });
message += res.t('privateMessageGiftGemsMessage', {gemAmount}); message += ` ${res.t('privateMessageGiftGemsMessage', {gemAmount})}`;
if (req.body.message) { if (req.body.message) {
message += req.body.message; message += req.body.message;