File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,27 @@ function tests(dbName, dbType) {
159159 } ) ;
160160 } ) ;
161161
162+ it ( 'transforms deleted docs if `handleDeleted: true` #18' , function ( ) {
163+ var doc = { _id : 'foo' , foo : { } } ;
164+ return db . put ( doc ) . then ( function ( res ) {
165+ doc . _rev = res . rev ;
166+ return db . get ( 'foo' ) ;
167+ } ) . then ( function ( doc ) {
168+ var transformCalledOnDelete = false ;
169+ db . transform ( {
170+ incoming : function ( doc ) {
171+ transformCalledOnDelete = true ;
172+ return doc ;
173+ } ,
174+ handleDeleted : true
175+ } ) ;
176+
177+ return db . remove ( doc ) . then ( function ( ) {
178+ transformCalledOnDelete . should . equal ( true ) ;
179+ } ) ;
180+ } ) ;
181+ } ) ;
182+
162183 // TODO: convert sync errors in user code into async errors
163184 it . skip ( 'handles sync errors' , function ( ) {
164185 db . transform ( {
You can’t perform that action at this time.
0 commit comments