From 5a2d7fdf815363cea4800c05ca607ee92efd1b55 Mon Sep 17 00:00:00 2001 From: Sergey Kirillov Date: Sat, 31 May 2014 13:49:24 +0300 Subject: [PATCH] Added mocked test as well --- tests/mithril-tests.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index c3874ad8..3a24b1fa 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -926,9 +926,19 @@ function testMithril(mock) { test(function() { return m.deps.factory.toString().indexOf("console") < 0 }) + + // config context + test(function() { + var root = mock.document.createElement("div") + + var success = false; + m.render(root, m("div", {config: function(elem, isInitialized, ctx) {ctx.data=1}})); + m.render(root, m("div", {config: function(elem, isInitialized, ctx) {success = ctx.data===1}})); + return success; + }) } //mocks testMithril(mock.window) -test.print(console.log) \ No newline at end of file +test.print(console.log)