@@ -27,40 +27,21 @@ function runTest(options) {
27
27
db . collection ( "testCommands" ) . findAndModify ( options . query , options . sort || { } , options . update , options . options , function ( err , res ) {
28
28
should . not . exist ( err ) ;
29
29
console . log ( JSON . stringify ( res ) ) ;
30
-
31
-
32
- if ( options . options . remove ) {
33
- res = res || { } ;
34
- if ( options . query . _id ) {
35
- res . should . have . property ( "_id" , options . query . _id ) ;
36
- }
37
- else {
38
- res . should . have . property ( "_id" ) ;
39
- }
40
-
41
- if ( options . query . name ) {
42
- res . should . have . property ( "name" , options . query . name ) ;
43
- }
44
- else {
45
- res . should . have . property ( "name" ) ;
30
+ res . should . have . property ( "value" ) ;
31
+ if ( options . options . new ) {
32
+ if ( options . update . $set . name ) {
33
+ res . value . should . have . property ( "name" , options . update . $set . name ) ;
46
34
}
47
35
}
48
36
else {
49
- res . should . have . property ( "value" ) ;
50
- if ( options . options . new ) {
51
- if ( options . update . $set . name ) {
52
- res . value . should . have . property ( "name" , options . update . $set . name ) ;
53
- }
54
- }
55
- else {
56
- if ( options . query . name ) {
57
- res . value . should . have . property ( "name" , options . query . name ) ;
58
- }
59
- }
60
- if ( options . query . _id ) {
61
- res . value . should . have . property ( "_id" , options . query . _id ) ;
37
+ if ( options . query . name ) {
38
+ res . value . should . have . property ( "name" , options . query . name ) ;
62
39
}
63
40
}
41
+ if ( options . query . _id ) {
42
+ res . value . should . have . property ( "_id" , options . query . _id ) ;
43
+ }
44
+
64
45
done ( ) ;
65
46
} ) ;
66
47
}
0 commit comments