@@ -803,10 +803,7 @@ describe('where() interface', function() {
803
803
let query = firestore . collection ( 'collectionId' ) ;
804
804
assert . throws ( function ( ) {
805
805
query = query . orderBy ( 'foo.' , '=' , 'foobar' ) ;
806
- } , new RegExp (
807
- 'Argument "fieldPath" is not a valid FieldPath. Paths must ' +
808
- "not start or end with '.'."
809
- ) ) ;
806
+ } , / A r g u m e n t " f i e l d P a t h " i s n o t a v a l i d F i e l d P a t h . P a t h s m u s t n o t s t a r t o r e n d w i t h ' .' ./ ) ;
810
807
} ) ;
811
808
812
809
it ( 'verifies operator' , function ( ) {
@@ -883,10 +880,7 @@ describe('orderBy() interface', function() {
883
880
let query = firestore . collection ( 'collectionId' ) ;
884
881
assert . throws ( function ( ) {
885
882
query = query . orderBy ( 'foo.' ) ;
886
- } , new RegExp (
887
- 'Argument "fieldPath" is not a valid FieldPath. Paths must ' +
888
- "not start or end with '.'."
889
- ) ) ;
883
+ } , / A r g u m e n t " f i e l d P a t h " i s n o t a v a l i d F i e l d P a t h . P a t h s m u s t n o t s t a r t o r e n d w i t h ' .' ./ ) ;
890
884
} ) ;
891
885
892
886
it ( 'rejects call after cursor' , function ( ) {
@@ -897,40 +891,28 @@ describe('orderBy() interface', function() {
897
891
. orderBy ( 'foo' )
898
892
. startAt ( 'foo' )
899
893
. orderBy ( 'foo' ) ;
900
- } , new RegExp (
901
- 'Cannot specify an orderBy\\(\\) constraint after calling ' +
902
- 'startAt\\(\\), startAfter\\(\\), endBefore\\(\\) or endAt\\(\\)\\.'
903
- ) ) ;
894
+ } , / C a n n o t s p e c i f y a n o r d e r B y \( \) c o n s t r a i n t a f t e r c a l l i n g s t a r t A t \( \) , s t a r t A f t e r \( \) , e n d B e f o r e \( \) o r e n d A t \( \) ./ ) ;
904
895
905
896
assert . throws ( function ( ) {
906
897
query = query
907
898
. where ( 'foo' , '>' , 'bar' )
908
899
. startAt ( snapshot ( 'collectionId/doc' , { foo : 'bar' } ) )
909
900
. where ( 'foo' , '>' , 'bar' ) ;
910
- } , new RegExp (
911
- 'Cannot specify a where\\(\\) filter after calling ' +
912
- 'startAt\\(\\), startAfter\\(\\), endBefore\\(\\) or endAt\\(\\)\\.'
913
- ) ) ;
901
+ } , / C a n n o t s p e c i f y a w h e r e \( \) f i l t e r a f t e r c a l l i n g s t a r t A t \( \) , s t a r t A f t e r \( \) , e n d B e f o r e \( \) o r e n d A t \( \) ./ ) ;
914
902
915
903
assert . throws ( function ( ) {
916
904
query = query
917
905
. orderBy ( 'foo' )
918
906
. endAt ( 'foo' )
919
907
. orderBy ( 'foo' ) ;
920
- } , new RegExp (
921
- 'Cannot specify an orderBy\\(\\) constraint after calling ' +
922
- 'startAt\\(\\), startAfter\\(\\), endBefore\\(\\) or endAt\\(\\)\\.'
923
- ) ) ;
908
+ } , / C a n n o t s p e c i f y a n o r d e r B y \( \) c o n s t r a i n t a f t e r c a l l i n g s t a r t A t \( \) , s t a r t A f t e r \( \) , e n d B e f o r e \( \) o r e n d A t \( \) ./ ) ;
924
909
925
910
assert . throws ( function ( ) {
926
911
query = query
927
912
. where ( 'foo' , '>' , 'bar' )
928
913
. endAt ( snapshot ( 'collectionId/doc' , { foo : 'bar' } ) )
929
914
. where ( 'foo' , '>' , 'bar' ) ;
930
- } , new RegExp (
931
- 'Cannot specify a where\\(\\) filter after calling ' +
932
- 'startAt\\(\\), startAfter\\(\\), endBefore\\(\\) or endAt\\(\\)\\.'
933
- ) ) ;
915
+ } , / C a n n o t s p e c i f y a w h e r e \( \) f i l t e r a f t e r c a l l i n g s t a r t A t \( \) , s t a r t A f t e r \( \) , e n d B e f o r e \( \) o r e n d A t \( \) ./ ) ;
934
916
} ) ;
935
917
936
918
it ( 'concatenates orders' , function ( ) {
@@ -1061,10 +1043,7 @@ describe('select() interface', function() {
1061
1043
1062
1044
assert . throws ( function ( ) {
1063
1045
query . select ( '.' ) ;
1064
- } , new RegExp (
1065
- 'Argument at index 0 is not a valid FieldPath. Paths must ' +
1066
- "not start or end with '.'."
1067
- ) ) ;
1046
+ } , / A r g u m e n t a t i n d e x 0 i s n o t a v a l i d F i e l d P a t h . P a t h s m u s t n o t s t a r t o r e n d w i t h ' .' ./ ) ;
1068
1047
} ) ;
1069
1048
1070
1049
it ( 'uses latest field mask' , function ( ) {
@@ -1152,36 +1131,36 @@ describe('startAt() interface', function() {
1152
1131
1153
1132
assert . throws ( ( ) => {
1154
1133
query . orderBy ( Firestore . FieldPath . documentId ( ) ) . startAt ( 42 ) ;
1155
- } , new RegExp ( ' The corresponding value for FieldPath.documentId\\(\\ ) must be a string or a DocumentReference\\.' ) ) ;
1134
+ } , / T h e c o r r e s p o n d i n g v a l u e f o r F i e l d P a t h .d o c u m e n t I d \( \ ) m u s t b e a s t r i n g o r a D o c u m e n t R e f e r e n c e . / ) ;
1156
1135
1157
1136
assert . throws ( ( ) => {
1158
1137
query
1159
1138
. orderBy ( Firestore . FieldPath . documentId ( ) )
1160
1139
. startAt ( firestore . doc ( 'coll/doc/other/doc' ) ) ;
1161
- } , new RegExp ( " 'coll/doc/other/doc' is not part of the query result set and cannot be used as a query boundary." ) ) ;
1140
+ } , / ' c o l l \ /d o c \ /o t h e r \ /d o c ' i s n o t p a r t o f t h e q u e r y r e s u l t s e t a n d c a n n o t b e u s e d a s a q u e r y b o u n d a r y ./ ) ;
1162
1141
1163
1142
assert . throws ( ( ) => {
1164
1143
query
1165
1144
. orderBy ( Firestore . FieldPath . documentId ( ) )
1166
1145
. startAt ( firestore . doc ( 'coll/doc/coll_suffix/doc' ) ) ;
1167
- } , new RegExp ( " 'coll/doc/coll_suffix/doc' is not part of the query result set and cannot be used as a query boundary." ) ) ;
1146
+ } , / ' c o l l \ /d o c \ /c o l l _ s u f f i x \ /d o c ' i s n o t p a r t o f t h e q u e r y r e s u l t s e t a n d c a n n o t b e u s e d a s a q u e r y b o u n d a r y ./ ) ;
1168
1147
1169
1148
assert . throws ( ( ) => {
1170
1149
query
1171
1150
. orderBy ( Firestore . FieldPath . documentId ( ) )
1172
1151
. startAt ( firestore . doc ( 'coll/doc' ) ) ;
1173
- } , new RegExp ( " 'coll/doc' is not part of the query result set and cannot be used as a query boundary." ) ) ;
1152
+ } , / ' c o l l \ /d o c ' i s n o t p a r t o f t h e q u e r y r e s u l t s e t a n d c a n n o t b e u s e d a s a q u e r y b o u n d a r y ./ ) ;
1174
1153
1175
1154
assert . throws ( ( ) => {
1176
1155
query
1177
1156
. orderBy ( Firestore . FieldPath . documentId ( ) )
1178
1157
. startAt ( firestore . doc ( 'coll/doc/coll/doc/coll/doc' ) ) ;
1179
- } , new RegExp ( " Only a direct child can be used as a query boundary. Found: 'coll/doc/coll/doc/coll/doc'." ) ) ;
1158
+ } , / O n l y a d i r e c t c h i l d c a n b e u s e d a s a q u e r y b o u n d a r y . F o u n d : ' c o l l \ /d o c \ /c o l l \ /d o c \ /c o l l \ /d o c ' ./ ) ;
1180
1159
1181
1160
// Validate that we can't pass a reference to a collection.
1182
1161
assert . throws ( ( ) => {
1183
1162
query . orderBy ( Firestore . FieldPath . documentId ( ) ) . startAt ( 'doc/coll' ) ;
1184
- } , new RegExp ( " Only a direct child can be used as a query boundary. Found: 'coll/doc/coll/doc/coll'." ) ) ;
1163
+ } , / O n l y a d i r e c t c h i l d c a n b e u s e d a s a q u e r y b o u n d a r y . F o u n d : ' c o l l \ /d o c \ /c o l l \ /d o c \ /c o l l ' ./ ) ;
1185
1164
} ) ;
1186
1165
1187
1166
it ( 'can specify document snapshot' , function ( ) {
@@ -1386,10 +1365,7 @@ describe('startAt() interface', function() {
1386
1365
let query = firestore . collection ( 'collectionId' ) ;
1387
1366
assert . throws ( function ( ) {
1388
1367
query . startAt ( 123 ) ;
1389
- } , new RegExp (
1390
- 'Too many cursor values specified\\. The specified values ' +
1391
- 'must match the orderBy\\(\\) constraints of the query\\.'
1392
- ) ) ;
1368
+ } , / T o o m a n y c u r s o r v a l u e s s p e c i f i e d . T h e s p e c i f i e d v a l u e s m u s t m a t c h t h e o r d e r B y \( \) c o n s t r a i n t s o f t h e q u e r y ./ ) ;
1393
1369
} ) ;
1394
1370
1395
1371
it ( 'uses latest value' , function ( ) {
@@ -1438,10 +1414,7 @@ describe('startAfter() interface', function() {
1438
1414
let query = firestore . collection ( 'collectionId' ) ;
1439
1415
assert . throws ( function ( ) {
1440
1416
query . startAfter ( 123 ) ;
1441
- } , new RegExp (
1442
- 'Too many cursor values specified\\. The specified values ' +
1443
- 'must match the orderBy\\(\\) constraints of the query\\.'
1444
- ) ) ;
1417
+ } , / T o o m a n y c u r s o r v a l u e s s p e c i f i e d . T h e s p e c i f i e d v a l u e s m u s t m a t c h t h e o r d e r B y \( \) c o n s t r a i n t s o f t h e q u e r y ./ ) ;
1445
1418
} ) ;
1446
1419
1447
1420
it ( 'uses latest value' , function ( ) {
@@ -1494,10 +1467,7 @@ describe('endAt() interface', function() {
1494
1467
let query = firestore . collection ( 'collectionId' ) ;
1495
1468
assert . throws ( function ( ) {
1496
1469
query . endAt ( 123 ) ;
1497
- } , new RegExp (
1498
- 'Too many cursor values specified\\. The specified values ' +
1499
- 'must match the orderBy\\(\\) constraints of the query\\.'
1500
- ) ) ;
1470
+ } , / T o o m a n y c u r s o r v a l u e s s p e c i f i e d . T h e s p e c i f i e d v a l u e s m u s t m a t c h t h e o r d e r B y \( \) c o n s t r a i n t s o f t h e q u e r y ./ ) ;
1501
1471
} ) ;
1502
1472
1503
1473
it ( 'uses latest value' , function ( ) {
@@ -1546,10 +1516,7 @@ describe('endBefore() interface', function() {
1546
1516
let query = firestore . collection ( 'collectionId' ) ;
1547
1517
assert . throws ( function ( ) {
1548
1518
query . endBefore ( 123 ) ;
1549
- } , new RegExp (
1550
- 'Too many cursor values specified\\. The specified values ' +
1551
- 'must match the orderBy\\(\\) constraints of the query\\.'
1552
- ) ) ;
1519
+ } , / T o o m a n y c u r s o r v a l u e s s p e c i f i e d . T h e s p e c i f i e d v a l u e s m u s t m a t c h t h e o r d e r B y \( \) c o n s t r a i n t s o f t h e q u e r y ./ ) ;
1553
1520
} ) ;
1554
1521
1555
1522
it ( 'uses latest value' , function ( ) {
0 commit comments