@@ -921,19 +921,14 @@ describe('firestore()', function () {
921
921
922
922
it ( 'snapshotsInSync fires' , async function ( ) {
923
923
if ( Platform . other ) {
924
+ // Should throw error for lite SDK
924
925
try {
925
- const testDoc = doc ( getFirestore ( ) , `${ COLLECTION } /snapshotsInSync` ) ;
926
-
927
- const promise = new Promise ( resolve => {
928
- const unsubscribe = onSnapshotsInSync ( getFirestore ( ) , ( ) => {
929
- events . push ( 'onSnapshotsInSync' ) ;
930
- unsubscribe ( ) ;
931
- resolve ( ) ;
932
- } ) ;
933
- } ) ;
926
+ const unsubscribe = onSnapshotsInSync ( getFirestore ( ) , ( ) => { } ) ;
927
+ unsubscribe ( ) ;
934
928
} catch ( e ) {
935
- e . message . should . containEql ( 'Not supported in the lite SDK' ) ;
929
+ e . message . should . equal ( 'Not supported in the lite SDK. ' ) ;
936
930
}
931
+ return ;
937
932
}
938
933
939
934
const events = [ ] ;
@@ -958,19 +953,14 @@ describe('firestore()', function () {
958
953
959
954
it ( 'handles multiple writes and unsubscribe correctly' , async function ( ) {
960
955
if ( Platform . other ) {
956
+ // Should throw error for lite SDK
961
957
try {
962
- const testDoc = doc ( getFirestore ( ) , `${ COLLECTION } /snapshotsInSync` ) ;
963
-
964
- const promise = new Promise ( resolve => {
965
- const unsubscribe = onSnapshotsInSync ( getFirestore ( ) , ( ) => {
966
- events . push ( 'onSnapshotsInSync' ) ;
967
- unsubscribe ( ) ;
968
- resolve ( ) ;
969
- } ) ;
970
- } ) ;
958
+ const unsubscribe = onSnapshotsInSync ( getFirestore ( ) , ( ) => { } ) ;
959
+ unsubscribe ( ) ;
971
960
} catch ( e ) {
972
- e . message . should . containEql ( 'Not supported in the lite SDK' ) ;
961
+ e . message . should . equal ( 'Not supported in the lite SDK. ' ) ;
973
962
}
963
+ return ;
974
964
}
975
965
976
966
const events = [ ] ;
@@ -988,21 +978,15 @@ describe('firestore()', function () {
988
978
} ) ;
989
979
} ) ;
990
980
991
- await Promise . all ( [
992
- setDoc ( testDoc1 , { test : 1 } ) ,
993
- setDoc ( testDoc2 , { test : 2 } )
994
- ] ) ;
981
+ await Promise . all ( [ setDoc ( testDoc1 , { test : 1 } ) , setDoc ( testDoc2 , { test : 2 } ) ] ) ;
995
982
996
983
await syncPromise ;
997
984
998
985
// Verify unsubscribe worked by doing another write
999
986
await setDoc ( testDoc1 , { test : 3 } ) ;
1000
987
1001
988
// Cleanup
1002
- await Promise . all ( [
1003
- deleteDoc ( testDoc1 ) ,
1004
- deleteDoc ( testDoc2 )
1005
- ] ) ;
989
+ await Promise . all ( [ deleteDoc ( testDoc1 ) , deleteDoc ( testDoc2 ) ] ) ;
1006
990
1007
991
events . length . should . be . greaterThan ( 0 ) ;
1008
992
events . forEach ( event => event . should . equal ( 'sync' ) ) ;
0 commit comments