Lint cleanup for tests
This commit is contained in:
@@ -185,7 +185,7 @@ asyncTest('Duplicate message suppression', function() {
|
|||||||
var message2 = randstring();
|
var message2 = randstring();
|
||||||
|
|
||||||
var callbacks = {
|
var callbacks = {
|
||||||
'onMessage': function (msg) {
|
'onMessage': function(msg) {
|
||||||
equal(msg['subject']['name'], subject, 'subject matches');
|
equal(msg['subject']['name'], subject, 'subject matches');
|
||||||
equal(msg['message'], message1, 'message matches');
|
equal(msg['message'], message1, 'message matches');
|
||||||
cosmo.shutdown();
|
cosmo.shutdown();
|
||||||
@@ -263,9 +263,12 @@ asyncTest('subscribe barrier', function() {
|
|||||||
// We are validating that the message event generated by the subscribe
|
// We are validating that the message event generated by the subscribe
|
||||||
// call has already been processed by the time this promise fires
|
// call has already been processed by the time this promise fires
|
||||||
equal(cosmo.getMessages(subject).length, 1, 'one message');
|
equal(cosmo.getMessages(subject).length, 1, 'one message');
|
||||||
equal(cosmo.getMessages(subject)[0]['subject']['name'], subject, 'subject matches');
|
equal(cosmo.getMessages(subject)[0]['subject']['name'], subject,
|
||||||
equal(cosmo.getMessages(subject)[0]['message'], message, 'message matches');
|
'subject matches');
|
||||||
deepEqual(cosmo.getMessages(subject)[0], cosmo.getLastMessage(subject), 'getLastMessage works');
|
equal(cosmo.getMessages(subject)[0]['message'], message,
|
||||||
|
'message matches');
|
||||||
|
deepEqual(cosmo.getMessages(subject)[0], cosmo.getLastMessage(subject),
|
||||||
|
'getLastMessage works');
|
||||||
cosmo.shutdown();
|
cosmo.shutdown();
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
@@ -299,7 +302,7 @@ asyncTest('Message ordering', function() {
|
|||||||
expect(3);
|
expect(3);
|
||||||
|
|
||||||
var subject = randstring();
|
var subject = randstring();
|
||||||
var messages = [ 'A', 'B', 'C', 'D' ];
|
var messages = ['A', 'B', 'C', 'D'];
|
||||||
|
|
||||||
var cosmo = new Cosmopolite({}, null, randstring());
|
var cosmo = new Cosmopolite({}, null, randstring());
|
||||||
|
|
||||||
@@ -440,7 +443,7 @@ asyncTest('pin/unpin', function() {
|
|||||||
cosmo.shutdown();
|
cosmo.shutdown();
|
||||||
start();
|
start();
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
var cosmo = new Cosmopolite(callbacks, null, randstring());
|
var cosmo = new Cosmopolite(callbacks, null, randstring());
|
||||||
cosmo.subscribe(subject);
|
cosmo.subscribe(subject);
|
||||||
@@ -471,7 +474,7 @@ asyncTest('Repin', function() {
|
|||||||
equal(subject, e['subject']['name'], 'onUnpin: subject matches');
|
equal(subject, e['subject']['name'], 'onUnpin: subject matches');
|
||||||
equal(message, e['message'], 'onUnpin: message matches');
|
equal(message, e['message'], 'onUnpin: message matches');
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
var cosmo = new Cosmopolite(callbacks, null, randstring());
|
var cosmo = new Cosmopolite(callbacks, null, randstring());
|
||||||
cosmo.subscribe(subject);
|
cosmo.subscribe(subject);
|
||||||
@@ -505,7 +508,7 @@ asyncTest('Duplicate subject', function() {
|
|||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
var cosmo = new Cosmopolite(callbacks, null, randstring());
|
var cosmo = new Cosmopolite(callbacks, null, randstring());
|
||||||
});
|
});
|
||||||
@@ -524,7 +527,9 @@ asyncTest('Login', function() {
|
|||||||
ok(true, 'onLogout fired');
|
ok(true, 'onLogout fired');
|
||||||
anonymousProfile = cosmo.currentProfile();
|
anonymousProfile = cosmo.currentProfile();
|
||||||
// Entirely magic URL that sets the login cookie and redirects.
|
// Entirely magic URL that sets the login cookie and redirects.
|
||||||
window.open('/_ah/login?email=test%40example.com&action=Login&continue=/cosmopolite/static/login_complete.html');
|
window.open(
|
||||||
|
'/_ah/login?email=test%40example.com&action=Login' +
|
||||||
|
'&continue=/cosmopolite/static/login_complete.html');
|
||||||
},
|
},
|
||||||
'onLogin': function(login_url) {
|
'onLogin': function(login_url) {
|
||||||
ok(true, 'onLogin fired');
|
ok(true, 'onLogin fired');
|
||||||
@@ -559,7 +564,9 @@ asyncTest('Profile merge', function() {
|
|||||||
if (messages == 1) {
|
if (messages == 1) {
|
||||||
cosmo.unsubscribe(subject);
|
cosmo.unsubscribe(subject);
|
||||||
// Entirely magic URL that sets the login cookie and redirects.
|
// Entirely magic URL that sets the login cookie and redirects.
|
||||||
window.open('/_ah/login?email=test%40example.com&action=Login&continue=/cosmopolite/static/login_complete.html');
|
window.open(
|
||||||
|
'/_ah/login?email=test%40example.com&action=Login' +
|
||||||
|
'&continue=/cosmopolite/static/login_complete.html');
|
||||||
}
|
}
|
||||||
if (messages == 2) {
|
if (messages == 2) {
|
||||||
cosmo.shutdown();
|
cosmo.shutdown();
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ curl \
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
gjslint --strict --disable=0121,0233 cosmopolite.js
|
gjslint --strict --disable=0121,0233 cosmopolite.js
|
||||||
|
gjslint --strict --disable=0121,0233 --nojsdoc test.js
|
||||||
|
|||||||
Reference in New Issue
Block a user