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 throw an exception if set when not subscribed', () => {
O = new FirebaseObjectObservable((observer: Observer) => { });
expect(() => {
O.set('foo');
}).toThrowError('No ref specified for this Observable!')
});
it('should return an instance of FirebaseObservable when calling operators', () => {
let O = new FirebaseObjectObservable((observer: Observer) => { });
expect(map.call(O, noop) instanceof FirebaseObjectObservable).toBe(true);
});
it('should throw an exception if updated when not subscribed', () => {
O = new FirebaseObjectObservable((observer: Observer) => { });
expect(() => {
O.update(updateObject);
}).toThrowError('No ref specified for this Observable!')
});
it('should throw an exception if removed when not subscribed', () => {
O = new FirebaseObjectObservable((observer: Observer) => { });
expect(() => {
O.remove();
}).toThrowError('No ref specified for this Observable!')
});
inject([FirebaseApp, AngularFireDatabase], (_app: FirebaseApp, _db: AngularFireDatabase) => {
app = _app;
db = _db;
ref = app.database().ref();
O = new FirebaseObjectObservable((observer: Observer) => {
}, ref);
})();
});