aboutsummaryrefslogtreecommitdiff
path: root/node_modules/event-emitter/test/all-off.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/event-emitter/test/all-off.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/event-emitter/test/all-off.js')
-rw-r--r--node_modules/event-emitter/test/all-off.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/node_modules/event-emitter/test/all-off.js b/node_modules/event-emitter/test/all-off.js
new file mode 100644
index 000000000..8aa872e9c
--- /dev/null
+++ b/node_modules/event-emitter/test/all-off.js
@@ -0,0 +1,48 @@
+'use strict';
+
+var ee = require('../');
+
+module.exports = function (t, a) {
+ var x, count, count2;
+
+ x = ee();
+ count = 0;
+ count2 = 0;
+ x.on('foo', function () {
+ ++count;
+ });
+ x.on('foo', function () {
+ ++count;
+ });
+ x.on('bar', function () {
+ ++count2;
+ });
+ x.on('bar', function () {
+ ++count2;
+ });
+ t(x, 'foo');
+ x.emit('foo');
+ x.emit('bar');
+ a(count, 0, "All off: type");
+ a(count2, 2, "All off: ohter type");
+
+ count = 0;
+ count2 = 0;
+ x.on('foo', function () {
+ ++count;
+ });
+ x.on('foo', function () {
+ ++count;
+ });
+ x.on('bar', function () {
+ ++count2;
+ });
+ x.on('bar', function () {
+ ++count2;
+ });
+ t(x);
+ x.emit('foo');
+ x.emit('bar');
+ a(count, 0, "All off: type");
+ a(count2, 0, "All off: other type");
+};