Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should handle empty sets', done => {
const aref = createRef(rando());
aref.set({});
snapshotChanges(aref).pipe(take(1)).subscribe(data => {
expect(data.length).toEqual(0);
}).add(done);
});
namefilter$.pipe(switchMap(name => {
const filteredRef = name ? aref.child('name').equalTo(name) : aref
return snapshotChanges(filteredRef);
}),take(2)).subscribe(data => {
count = count + 1;
function prepareSnapshotChanges(opts: { events?: ChildEvent[], skipnumber: number } = { skipnumber: 0 }) {
const { events, skipnumber } = opts;
const aref = createRef(rando());
const snapChanges = snapshotChanges(aref, events);
return {
snapChanges: snapChanges.pipe(skip(skipnumber)),
ref: aref
};
}