@@ -162,14 +162,11 @@ describe("Nested Database", () => {
162162 } ) ;
163163
164164 it ( "add a nested value" , async ( ) => {
165- const hash1 = await db . put ( "a/b" , 1 ) ;
166- const hash2 = await db . put ( "a/c" , 2 ) ;
165+ await db . put ( "a/b" , 1 ) ;
166+ await db . put ( "a/c" , 2 ) ;
167167
168168 const actual = await db . all ( ) ;
169- expect ( actual ) . to . have . deep . members ( [
170- { key : "a/b" , value : 1 , hash : hash1 } ,
171- { key : "a/c" , value : 2 , hash : hash2 } ,
172- ] ) ;
169+ expect ( actual ) . to . deep . equal ( { a : { b : 1 , c : 2 } } ) ;
173170 } ) ;
174171
175172 it ( "get a nested value" , async ( ) => {
@@ -195,14 +192,11 @@ describe("Nested Database", () => {
195192 } ) ;
196193
197194 it ( "add a nested value - list syntax" , async ( ) => {
198- const hash1 = await db . put ( [ "a" , "b" ] , 1 ) ;
199- const hash2 = await db . put ( [ "a" , "c" ] , 2 ) ;
195+ await db . put ( [ "a" , "b" ] , 1 ) ;
196+ await db . put ( [ "a" , "c" ] , 2 ) ;
200197
201198 const actual = await db . all ( ) ;
202- expect ( actual ) . to . have . deep . members ( [
203- { key : "a/b" , value : 1 , hash : hash1 } ,
204- { key : "a/c" , value : 2 , hash : hash2 } ,
205- ] ) ;
199+ expect ( actual ) . to . deep . equal ( { a : { b : 1 , c : 2 } } ) ;
206200 } ) ;
207201
208202 it ( "remove root key" , async ( ) => {
@@ -219,35 +213,32 @@ describe("Nested Database", () => {
219213 await db . put ( "a/b" , 1 ) ;
220214 await db . put ( "a/c" , 2 ) ;
221215
222- const hash = await db . put ( "a" , 3 ) ;
216+ await db . put ( "a" , 3 ) ;
223217
224218 const actual = await db . all ( ) ;
225- expect ( actual ) . to . have . deep . members ( [ { key : "a" , value : 3 , hash } ] ) ;
219+ expect ( actual ) . to . deep . equal ( { a : 3 } ) ;
226220 } ) ;
227221
228222 it ( "put nested" , async ( ) => {
229- const hashes = await db . putNested ( { a : { b : 1 , c : 2 } } ) ;
223+ await db . putNested ( { a : { b : 1 , c : 2 } } ) ;
230224
231225 const actual = await db . all ( ) ;
232- expect ( actual ) . to . have . deep . members ( [
233- { key : "a/b" , value : 1 , hash : hashes [ 0 ] } ,
234- { key : "a/c" , value : 2 , hash : hashes [ 1 ] } ,
235- ] ) ;
226+ expect ( actual ) . to . deep . equal ( { a : { b : 1 , c : 2 } } ) ;
236227 } ) ;
237228
238229 it ( "put key nested value" , async ( ) => {
239230 await db . put ( "a" , { b : 2 , c : 3 } ) ;
240231 await db . put ( "a" , { b : 1 } ) ;
241232
242- const actual = toNested ( await db . all ( ) ) ;
233+ const actual = await db . all ( ) ;
243234 expect ( actual ) . to . deep . equal ( { a : { b : 1 } } ) ;
244235 } ) ;
245236
246237 it ( "put nested value merges with previous values" , async ( ) => {
247238 await db . put ( "a" , { b : 2 , c : 3 } ) ;
248239 await db . putNested ( "a" , { b : 1 } ) ;
249240
250- const actual = toNested ( await db . all ( ) ) ;
241+ const actual = await db . all ( ) ;
251242 expect ( actual ) . to . deep . equal ( { a : { b : 1 , c : 3 } } ) ;
252243 } ) ;
253244
0 commit comments