Commit 1b1aec20f699264fff7f670692558fad240c0825
Reorder tests a little for clarity.
Piet Geursen committed on 12/10/2016, 5:00:28 AMParent: dc1e0540e6cdbe6af6955e06be52bb58d0e33115
Files changed
test/array.js | changed |
test/array.js | ||
---|---|---|
@@ -33,8 +33,19 @@ | ||
33 | 33 … | }) |
34 | 34 … | array.set(expected) |
35 | 35 … | }) |
36 | 36 … | |
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 … | + | |
37 | 48 … | test('#push inserts a new element and calls subscriber', function(t) { |
38 | 49 … | var expected = ['cat','dog'] |
39 | 50 … | var array = MutantArray(['cat']) |
40 | 51 … | array(actual => { |
@@ -53,8 +64,9 @@ | ||
53 | 64 … | }) |
54 | 65 … | array.insert('dog', 0) |
55 | 66 … | }) |
56 | 67 … | |
68 … | + | |
57 | 69 … | test('#delete removes basic element and calls subscriber', function(t) { |
58 | 70 … | var expected = ['dog'] |
59 | 71 … | var array = MutantArray(['cat', 'dog']) |
60 | 72 … | array(actual => { |
@@ -77,14 +89,4 @@ | ||
77 | 89 … | array.delete(dog) //array will emit |
78 | 90 … | cat.set('Kool kat') //array and cat will emit. |
79 | 91 … | }) |
80 | 92 … | |
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