From 3578d0ffb38790a84d52271079adc5ded26b9d0d Mon Sep 17 00:00:00 2001 From: eladzlot Date: Fri, 24 Mar 2017 11:53:54 +0300 Subject: [PATCH] added test for stream.end.map Tests for issue #1736 Any maps set to the end stream do not get called. In fact, for some reason adding a map to and end stream throws an error: ``` Cannot read property '_state' of undefined at updateDependency (/Users/eladzlot/www/mithril.js/stream/stream.js:46:20) ``` --- stream/tests/test-stream.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stream/tests/test-stream.js b/stream/tests/test-stream.js index 89dd713a..84aff934 100644 --- a/stream/tests/test-stream.js +++ b/stream/tests/test-stream.js @@ -263,6 +263,15 @@ o.spec("stream", function() { o(doubled()).equals(4) }) + o("end stream can be mapped to", function() { + var stream = Stream() + var spy = o.spy() + + stream.end.map(spy) + stream.end(true) + + o(spy.callCount).equals(1) + }) }) o.spec("valueOf", function() { o("works", function() {