git ssb

1+

Matt McKegg / mutant



Commit 1b1aec20f699264fff7f670692558fad240c0825

Reorder tests a little for clarity.

Piet Geursen committed on 12/10/2016, 5:00:28 AM
Parent: dc1e0540e6cdbe6af6955e06be52bb58d0e33115

Files changed

test/array.jschanged
test/array.jsView
@@ -33,8 +33,19 @@
3333 })
3434 array.set(expected)
3535 })
3636
37 +test('Array will call subscriber when an observable in the array is updated', function(t) {
38 + var obs = MutantValue(1)
39 + var array = MutantArray([obs])
40 + array(arr => {
41 + actual = arr[0]
42 + t.equal(actual, 2)
43 + t.end()
44 + })
45 + obs.set(2)
46 +})
47 +
3748 test('#push inserts a new element and calls subscriber', function(t) {
3849 var expected = ['cat','dog']
3950 var array = MutantArray(['cat'])
4051 array(actual => {
@@ -53,8 +64,9 @@
5364 })
5465 array.insert('dog', 0)
5566 })
5667
68 +
5769 test('#delete removes basic element and calls subscriber', function(t) {
5870 var expected = ['dog']
5971 var array = MutantArray(['cat', 'dog'])
6072 array(actual => {
@@ -77,14 +89,4 @@
7789 array.delete(dog) //array will emit
7890 cat.set('Kool kat') //array and cat will emit.
7991 })
8092
81-test('Array will call subscriber when an observable in the array is updated', function(t) {
82- var obs = MutantValue(1)
83- var array = MutantArray([obs])
84- array(arr => {
85- actual = arr[0]
86- t.equal(actual, 2)
87- t.end()
88- })
89- obs.set(2)
90-})

Built with git-ssb-web