@@ -3,7 +3,7 @@ import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'
33import { AngularFireDatabase , AngularFireDatabaseModule , listChanges } from 'angularfire2/database' ;
44import { TestBed , inject } from '@angular/core/testing' ;
55import { COMMON_CONFIG } from '../test-config' ;
6- import 'rxjs/add/operator/skip ' ;
6+ import { skip , take } from 'rxjs/operators ' ;
77
88// generate random string to test fidelity of naming
99const rando = ( ) => ( Math . random ( ) + 1 ) . toString ( 36 ) . substring ( 7 ) ;
@@ -46,7 +46,7 @@ describe('listChanges', () => {
4646 it ( 'should stream value at first' , ( done ) => {
4747 const someRef = ref ( rando ( ) ) ;
4848 const obs = listChanges ( someRef , [ 'child_added' ] ) ;
49- const sub = obs . take ( 1 ) . subscribe ( changes => {
49+ const sub = obs . pipe ( take ( 1 ) ) . subscribe ( changes => {
5050 const data = changes . map ( change => change . payload . val ( ) ) ;
5151 expect ( data ) . toEqual ( items ) ;
5252 } ) . add ( done ) ;
@@ -56,7 +56,7 @@ describe('listChanges', () => {
5656 it ( 'should process a new child_added event' , done => {
5757 const aref = ref ( rando ( ) ) ;
5858 const obs = listChanges ( aref , [ 'child_added' ] ) ;
59- const sub = obs . skip ( 1 ) . take ( 1 ) . subscribe ( changes => {
59+ const sub = obs . pipe ( skip ( 1 ) , take ( 1 ) ) . subscribe ( changes => {
6060 const data = changes . map ( change => change . payload . val ( ) ) ;
6161 expect ( data [ 3 ] ) . toEqual ( { name : 'anotha one' } ) ;
6262 } ) . add ( done ) ;
@@ -67,7 +67,7 @@ describe('listChanges', () => {
6767 it ( 'should stream in order events' , ( done ) => {
6868 const aref = ref ( rando ( ) ) ;
6969 const obs = listChanges ( aref . orderByChild ( 'name' ) , [ 'child_added' ] ) ;
70- const sub = obs . take ( 1 ) . subscribe ( changes => {
70+ const sub = obs . pipe ( take ( 1 ) ) . subscribe ( changes => {
7171 const names = changes . map ( change => change . payload . val ( ) . name ) ;
7272 expect ( names [ 0 ] ) . toEqual ( 'one' ) ;
7373 expect ( names [ 1 ] ) . toEqual ( 'two' ) ;
@@ -79,7 +79,7 @@ describe('listChanges', () => {
7979 it ( 'should stream in order events w/child_added' , ( done ) => {
8080 const aref = ref ( rando ( ) ) ;
8181 const obs = listChanges ( aref . orderByChild ( 'name' ) , [ 'child_added' ] ) ;
82- const sub = obs . skip ( 1 ) . take ( 1 ) . subscribe ( changes => {
82+ const sub = obs . pipe ( skip ( 1 ) , take ( 1 ) ) . subscribe ( changes => {
8383 const names = changes . map ( change => change . payload . val ( ) . name ) ;
8484 expect ( names [ 0 ] ) . toEqual ( 'anotha one' ) ;
8585 expect ( names [ 1 ] ) . toEqual ( 'one' ) ;
@@ -93,7 +93,7 @@ describe('listChanges', () => {
9393 it ( 'should stream events filtering' , ( done ) => {
9494 const aref = ref ( rando ( ) ) ;
9595 const obs = listChanges ( aref . orderByChild ( 'name' ) . equalTo ( 'zero' ) , [ 'child_added' ] ) ;
96- obs . skip ( 1 ) . take ( 1 ) . subscribe ( changes => {
96+ obs . pipe ( skip ( 1 ) , take ( 1 ) ) . subscribe ( changes => {
9797 const names = changes . map ( change => change . payload . val ( ) . name ) ;
9898 expect ( names [ 0 ] ) . toEqual ( 'zero' ) ;
9999 expect ( names [ 1 ] ) . toEqual ( 'zero' ) ;
@@ -105,7 +105,7 @@ describe('listChanges', () => {
105105 it ( 'should process a new child_removed event' , done => {
106106 const aref = ref ( rando ( ) ) ;
107107 const obs = listChanges ( aref , [ 'child_added' , 'child_removed' ] ) ;
108- const sub = obs . skip ( 1 ) . take ( 1 ) . subscribe ( changes => {
108+ const sub = obs . pipe ( skip ( 1 ) , take ( 1 ) ) . subscribe ( changes => {
109109 const data = changes . map ( change => change . payload . val ( ) ) ;
110110 expect ( data . length ) . toEqual ( items . length - 1 ) ;
111111 } ) . add ( done ) ;
@@ -118,7 +118,7 @@ describe('listChanges', () => {
118118 it ( 'should process a new child_changed event' , ( done ) => {
119119 const aref = ref ( rando ( ) ) ;
120120 const obs = listChanges ( aref , [ 'child_added' , 'child_changed' ] )
121- const sub = obs . skip ( 1 ) . take ( 1 ) . subscribe ( changes => {
121+ const sub = obs . pipe ( skip ( 1 ) , take ( 1 ) ) . subscribe ( changes => {
122122 const data = changes . map ( change => change . payload . val ( ) ) ;
123123 expect ( data [ 1 ] . name ) . toEqual ( 'lol' ) ;
124124 } ) . add ( done ) ;
@@ -131,7 +131,7 @@ describe('listChanges', () => {
131131 it ( 'should process a new child_moved event' , ( done ) => {
132132 const aref = ref ( rando ( ) ) ;
133133 const obs = listChanges ( aref , [ 'child_added' , 'child_moved' ] )
134- const sub = obs . skip ( 1 ) . take ( 1 ) . subscribe ( changes => {
134+ const sub = obs . pipe ( skip ( 1 ) , take ( 1 ) ) . subscribe ( changes => {
135135 const data = changes . map ( change => change . payload . val ( ) ) ;
136136 // We moved the first item to the last item, so we check that
137137 // the new result is now the last result
0 commit comments