Allow m.prop to be JSON.stringify-ed

This commit is contained in:
Thomas Dy 2014-04-19 10:39:01 +08:00
parent d7b64ceab2
commit 95affb1cb2
2 changed files with 13 additions and 1 deletions

View file

@ -389,6 +389,14 @@ function testMithril(mock) {
prop("foo")
return prop() == "foo"
})
test(function() {
var prop = m.prop("test")
return JSON.stringify(prop) == "\"test\""
})
test(function() {
var obj = { prop: m.prop("test") }
return JSON.stringify(obj) == "{\"prop\":\"test\"}"
})
//m.request
test(function() {