mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 14:54:33 +00:00
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…
x
Reference in New Issue
Block a user