From df6194bfbaaa59b174d599389cff1640ad502f7d Mon Sep 17 00:00:00 2001 From: iofjuupasli Date: Mon, 8 Jun 2015 15:36:55 +0300 Subject: [PATCH] testing case: merge on atomic update --- test/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/index.js b/test/index.js index a8a8746..47e5f1d 100644 --- a/test/index.js +++ b/test/index.js @@ -451,6 +451,18 @@ function fastUpdate(s, n) { assert(s1and2.end()); assert.deepEqual(result, [12, 2, 4, 44, 1, 12, 2]); }); + it('emmits all events from atomic update', function () { + var result = []; + var a = stream(1); + var b = stream([a], function() { return a() * 2; }); + var c = stream([a], function() { return a() + 4; }); + var d = flyd.merge(b, c); + stream([d], function () { + result.push(d()); + }); + a(2); + assert.deepEqual(result, [2, 5, 4, 6]); + }); }); describe('ap', function() { it('applies functions in stream', function() {