From 445087c606f9115d0f85059326f2000d62556947 Mon Sep 17 00:00:00 2001 From: "C. James Winslow" Date: Wed, 10 Sep 2014 16:20:42 -0700 Subject: [PATCH] changed the tests to expect that m.module returns the instance of module.controller that was passed to it --- tests/mithril-tests.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index cafddc10..975ece3f 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -34,20 +34,21 @@ function testMithril(mock) { mock.requestAnimationFrame.$resolve() var root1 = mock.document.createElement("div") - m.module(root1, { + var mod1 = m.module(root1, { controller: function() {this.value = "test1"}, view: function(ctrl) {return ctrl.value} }) var root2 = mock.document.createElement("div") - m.module(root2, { + var mod2 = m.module(root2, { controller: function() {this.value = "test2"}, view: function(ctrl) {return ctrl.value} }) mock.requestAnimationFrame.$resolve() - return root1.childNodes[0].nodeValue === "test1" && root2.childNodes[0].nodeValue === "test2" + return (root1.childNodes[0].nodeValue === "test1" && root2.childNodes[0].nodeValue === "test2") + && (mod1.value && mod1.value === "test1") && (mod2.value && mod2.value === "test2") }) //m.withAttr