We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f42cd2 commit cfa4fedCopy full SHA for cfa4fed
test/index.js
@@ -56,3 +56,22 @@ tape('end', function (t) {
56
t.equal(notify(r), r)
57
notify.end()
58
})
59
+
60
+tape('end immediately upon delivery', function (t) {
61
+ var notify = Notify()
62
+ var r = Math.random()
63
+ var n = 1
64
65
+ pull(
66
+ notify.listen(),
67
+ pull.drain(function (data) {
68
+ t.equal(data, r)
69
+ notify.end()
70
+ }, function () {
71
+ if (--n) return
72
+ t.end()
73
+ })
74
+ )
75
76
+ t.equal(notify(r), r)
77
+})
0 commit comments