@@ -121,10 +121,10 @@ describe('Database@exp Tests', () => {
121
121
unsubscribe ( ) ;
122
122
} ) ;
123
123
124
- it ( 'can properly handle unknown deep merges' , async ( ) => {
124
+ it . only ( 'can properly handle unknown deep merges' , async ( ) => {
125
125
const database = getDatabase ( defaultApp ) ;
126
126
const root = ref ( database , 'testing' ) ;
127
- await remove ( root ) ;
127
+ await set ( root , { } ) ;
128
128
129
129
const q = query ( root , orderByChild ( 'testIndex' ) , limitToFirst ( 2 ) ) ;
130
130
@@ -146,9 +146,8 @@ describe('Database@exp Tests', () => {
146
146
action : 'test'
147
147
}
148
148
} ) ;
149
- const ec = EventAccumulatorFactory . waitsForExactCount ( 1 ) ;
149
+ const ec = EventAccumulatorFactory . waitsForExactCount ( 2 ) ;
150
150
const onChildAddedCb = onChildAdded ( q , snap => {
151
- const value = snap . val ( ) ;
152
151
ec . addEvent ( snap ) ;
153
152
} ) ;
154
153
const onValueCb = onValue ( i1 , ( ) => {
@@ -157,11 +156,13 @@ describe('Database@exp Tests', () => {
157
156
await update ( i1 , {
158
157
timestamp : `${ Date . now ( ) } |1`
159
158
} ) ;
160
- const [ result ] = await ec . promise ;
161
- const value = result . val ( ) ;
162
- expect ( value ) . to . haveOwnProperty ( 'timestamp' ) ;
163
- expect ( value ) . to . haveOwnProperty ( 'action' ) ;
164
- expect ( value ) . to . haveOwnProperty ( 'testIndex' ) ;
159
+ const results = await ec . promise ;
160
+ results . forEach ( result => {
161
+ const value = result . val ( ) ;
162
+ expect ( value ) . to . haveOwnProperty ( 'timestamp' ) ;
163
+ expect ( value ) . to . haveOwnProperty ( 'action' ) ;
164
+ expect ( value ) . to . haveOwnProperty ( 'testIndex' ) ;
165
+ } ) ;
165
166
onChildAddedCb ( ) ;
166
167
onValueCb ( ) ;
167
168
} ) ;
0 commit comments