@@ -19,7 +19,6 @@ function runSuite (factory) {
19
19
factory : factory ,
20
20
21
21
// Unsupported features
22
- seek : false ,
23
22
createIfMissing : false ,
24
23
errorIfExists : false ,
25
24
@@ -73,7 +72,6 @@ suite({
73
72
return subdb ( levelup ( encoding ( memdown ( ) ) ) , 'test' )
74
73
} ,
75
74
// Unsupported features
76
- seek : false ,
77
75
createIfMissing : false ,
78
76
errorIfExists : false ,
79
77
@@ -133,6 +131,38 @@ test('SubDown constructor', function (t) {
133
131
} )
134
132
135
133
test ( 'SubDb main function' , function ( t ) {
134
+ t . test ( 'inherits manifest from parent db' , function ( t ) {
135
+ var down = memdown ( )
136
+ down . supports . foo = true
137
+
138
+ var up = levelup ( down )
139
+ t . is ( up . supports . foo , true , 'levelup inherits from down' )
140
+ up . supports . bar = true
141
+
142
+ var sub = subdb ( up )
143
+ t . is ( sub . supports . foo , true , 'subdb inherits from down via levelup' )
144
+ t . is ( sub . supports . seek , true , 'subdb inherits from down via levelup' )
145
+ t . is ( sub . supports . bar , true , 'subdb inherits from levelup' )
146
+ t . end ( )
147
+ } )
148
+
149
+ t . test ( 'does not support additionalMethods' , function ( t ) {
150
+ var down = memdown ( )
151
+ down . supports . additionalMethods . foo = true
152
+
153
+ // We're expecting that levelup exposes the additionalMethod
154
+ var up = levelup ( down )
155
+ t . is ( up . supports . additionalMethods . foo , true )
156
+ t . is ( typeof up . foo , 'function' , 'levelup exposes method' )
157
+
158
+ // But that subdb removes it (although it is itself a levelup)
159
+ // because it can't automatically prefix any key(-like) arguments
160
+ var sub = subdb ( up )
161
+ t . same ( sub . supports . additionalMethods , { } )
162
+ t . is ( typeof sub . foo , 'undefined' , 'subdb does not expose method' )
163
+ t . end ( )
164
+ } )
165
+
136
166
t . test ( 'opts.open hook' , function ( t ) {
137
167
t . plan ( 1 )
138
168
subdb ( levelup ( memdown ( ) ) , 'test' , {
0 commit comments