You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A GeoJSON GeometryCollection contains a "geometries" member with an array of GeoJSON geometry objects.
This matcher uses the toBeGeometryCollection functionality to verify the input is a properly formatted GeometryCollection object, and then determine if it has between Range1 and Range2 number of geometry objects in its "geometries". It will throw an error for any of the other geometry types as it is a trivial comparison on those.
Omitting Range2 or setting it equal to the value of Range1 will causes the matcher to check for exactly the number of geometries specified by Range1.
Checking Range2 less than Range1 will throw an error.
Passing a number less than 0 for either will throw an error.
Decimals will get truncated on both Range1 and Range2.
Will throw an error if Range2 is defined and Range1 is not.
If omitting both Range1 and Range2, it passes if at least one geometry object is contained in "geometries".
Description
A GeoJSON GeometryCollection contains a "geometries" member with an array of GeoJSON geometry objects.
This matcher uses the toBeGeometryCollection functionality to verify the input is a properly formatted GeometryCollection object, and then determine if it has between
Range1
andRange2
number of geometry objects in its "geometries". It will throw an error for any of the other geometry types as it is a trivial comparison on those.Omitting
Range2
or setting it equal to the value ofRange1
will causes the matcher to check for exactly the number of geometries specified byRange1
.Checking
Range2
less thanRange1
will throw an error.Passing a number less than 0 for either will throw an error.
Decimals will get truncated on both
Range1
andRange2
.Will throw an error if
Range2
is defined andRange1
is not.If omitting both
Range1
andRange2
, it passes if at least one geometry object is contained in "geometries".Example Matcher Usage
Passing Tests
Good GeometryCollection
Failing Tests
Invalid Inputs To Matcher
Rejects each of the following:
undefined
,null
,false
,true
,0
,NaN
{ someProp: 'I am not GeoJSON', id: 4 }
{}
''
,'Random Feature',
Valid GeometryCollection With Range1 and Range2 Problems
Range2
less than validRange1
Range1
undefined and validRange2
Range1
as each of the values in "Invalid Inputs To Matcher" except 0Range2
as each of the values in "Invalid Inputs To Matcher" except 0Range1
andRange2
as each of the values in "Invalid Inputs To Matcher" except 0Valid GeometryCollection With Negative Ranges
Valid GeometryCollection With Out of Range Range1 and Range2
The text was updated successfully, but these errors were encountered: