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)