Update test to ensure unique listener callback behavior
This commit is contained in:
parent
83869e2193
commit
2f4bcee5ce
|
@ -289,8 +289,11 @@ module.exports = BaseTest.extend({
|
|||
var secondNotificationCount = 0;
|
||||
function secondNotification(realm, name) {
|
||||
secondNotificationCount++;
|
||||
};
|
||||
realm.addListener('change', secondNotification)
|
||||
}
|
||||
|
||||
// The listener should only be added once.
|
||||
realm.addListener('change', secondNotification);
|
||||
realm.addListener('change', secondNotification);
|
||||
|
||||
realm.write(function() {});
|
||||
TestCase.assertEqual(notificationCount, 2);
|
||||
|
|
Loading…
Reference in New Issue