allow resolving w/ no value

This commit is contained in:
Leo Horie 2014-05-18 19:47:46 -04:00
parent 67c5400d44
commit 46565f2e03
3 changed files with 27 additions and 6 deletions

View file

@ -742,6 +742,24 @@ function testMithril(mock) {
deferred.reject(2)
return value === 1
})
test(function() {
//https://github.com/lhorie/mithril.js/issues/85
var deferred = m.deferred(), value
deferred.resolve()
deferred.promise.then(function(data) {
value = 1
})
return value === 1
})
test(function() {
//https://github.com/lhorie/mithril.js/issues/85
var deferred = m.deferred(), value
deferred.reject()
deferred.promise.then(null, function(data) {
value = 1
})
return value === 1
})
//m.sync
test(function() {