add test for m.sync pr

This commit is contained in:
Leo Horie 2014-05-29 08:21:05 -04:00
parent 95d2a58abb
commit 9e5bd07235
2 changed files with 10 additions and 0 deletions

View file

@ -5,6 +5,7 @@
### Bug Fixes:
- `m.sync` now correctly passes arguments to resolver in same order as input arguments [#96](https://github.com/lhorie/mithril.js/issues/96)
- fixed diff deletion bug [#99](https://github.com/lhorie/mithril.js/issues/99)
- updating textarea attributes updates its value correctly [#100](https://github.com/lhorie/mithril.js/issues/100)
---

View file

@ -893,6 +893,15 @@ function testMithril(mock) {
deferred2.resolve("foo")
return value[0] === "test" && value[1] === "foo"
})
test(function() {
var value
var deferred1 = m.deferred()
var deferred2 = m.deferred()
m.sync([deferred1.promise, deferred2.promise]).then(function(data) {value = data})
deferred2.resolve("foo")
deferred1.resolve("test")
return value[0] === "test" && value[1] === "foo"
})
//m.startComputation/m.endComputation
test(function() {