@@ -108,7 +108,8 @@ describe( 'Channel', function() {
108108 done ( ) ;
109109 } ) ;
110110
111- bucket . update ( '12345' , { content : 'Hola mundo!' } ) ;
111+ const updateArgs = { id : '12345' , data : { content : 'Hola mundo!' } }
112+ bucket . update ( updateArgs ) ;
112113 } ) ;
113114
114115 it ( 'should not send a change with an empty diff' , function ( done ) {
@@ -121,7 +122,7 @@ describe( 'Channel', function() {
121122 channel . once ( 'unmodified' , function ( ) {
122123 done ( ) ;
123124 } ) ;
124- bucket . update ( 'thing' , data ) ;
125+ bucket . update ( { id : 'thing' , data} ) ;
125126 } ) ;
126127 } ) ;
127128
@@ -131,21 +132,21 @@ describe( 'Channel', function() {
131132 checkSent = function ( ) {
132133 throw new Error ( 'Sent too many changes' ) ;
133134 } ,
134- objectId = '123456' ;
135+ id = '123456' ;
135136
136137 channel . on ( 'send' , fn . counts ( 1 , checkSent ) ) ;
137138
138139 channel . on ( 'send' , function ( ) {
139- bucket . update ( objectId , data2 ) ;
140+ bucket . update ( { id , data : data2 } ) ;
140141 } )
141142
142143 channel . localQueue . on ( 'wait' , function ( id ) {
143144 equal ( id , objectId ) ;
144145 done ( ) ;
145146 } ) ;
146147
147- objectId = '123456' ;
148- bucket . update ( objectId , data ) ;
148+ const objectId = '123456' ;
149+ bucket . update ( { id : objectId , data} ) ;
149150 } ) ;
150151
151152 it ( 'should acknowledge sent change' , function ( done ) {
@@ -160,7 +161,7 @@ describe( 'Channel', function() {
160161 acknowledge ( channel , msg ) ;
161162 } ) ;
162163
163- bucket . update ( 'mock-id' , data ) ;
164+ bucket . update ( { id : 'mock-id' , data } ) ;
164165 } ) ;
165166
166167 it ( 'should ignore duplicate change error if nothing to acknowledge' , ( done ) => {
@@ -225,13 +226,14 @@ describe( 'Channel', function() {
225226
226227 channel . localQueue . on ( 'wait' , validate ) ;
227228
229+ const id = '123' ;
228230 channel . once ( 'send' , function ( ) {
229- bucket . update ( '123' , { title : 'hello again world' } ) ;
230- bucket . remove ( '123' ) ;
231+ bucket . update ( { id , data : { title : 'hello again world' } } ) ;
232+ bucket . remove ( id ) ;
231233 } ) ;
232234
233235 store . put ( '123' , 3 , { title : 'hello world' } ) . then ( function ( ) {
234- bucket . update ( '123' , { title : 'goodbye world' } ) ;
236+ bucket . update ( { id , data : { title : 'goodbye world' } } ) ;
235237 } ) ;
236238 } ) ;
237239
@@ -266,7 +268,7 @@ describe( 'Channel', function() {
266268 } , reject ) ;
267269 } ) ;
268270
269- bucket . update ( key , { title : 'hello world' } , null , null , null , function ( ) {
271+ bucket . update ( { id : key , data : { title : 'hello world' } } , function ( ) {
270272 channel . handleMessage ( 'c:' + JSON . stringify ( [ {
271273 o : '-' , ev : 1 , cv : 'cv1' , id : key
272274 } ] ) ) ;
@@ -319,8 +321,9 @@ describe( 'Channel', function() {
319321 } ) ;
320322 } ) ;
321323
322- store . put ( '123' , 3 , { title : 'hello world' } ) . then ( function ( ) {
323- bucket . update ( '123' , { title : 'goodbye world!!' } ) ;
324+ const id = '123' ;
325+ store . put ( id , 3 , { title : 'hello world' } ) . then ( function ( ) {
326+ bucket . update ( { id, data : { title : 'goodbye world!!' } } ) ;
324327 } ) ;
325328 } ) ;
326329
@@ -352,7 +355,7 @@ describe( 'Channel', function() {
352355 } ] ) ) ;
353356
354357 // We're changing "Hello world" to "Goodbye world"
355- bucket . update ( key , { title : 'Goodbye world' } ) ;
358+ bucket . update ( { id : key , data : { title : 'Goodbye world' } } ) ;
356359 } ) ) ;
357360
358361 it ( 'should emit errors on the bucket instance' , ( done ) => {
@@ -426,7 +429,7 @@ describe( 'Channel', function() {
426429 acknowledge ( channel , msg ) ;
427430 } ) ;
428431
429- bucket . update ( 'mock-id' , data ) ;
432+ bucket . update ( { id : 'mock-id' , data} ) ;
430433 } ) ;
431434
432435 it ( 'should get version' , ( done ) => {
0 commit comments