-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(toBeAnyGeometry): add robust snapshot tests
Adds extensive snapshot testing to address #32.
- Loading branch information
1 parent
472d12d
commit 8a6e611
Showing
2 changed files
with
91 additions
and
68 deletions.
There are no files selected for viewing
30 changes: 23 additions & 7 deletions
30
tests/geometries/__snapshots__/toBeAnyGeometry.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect({type: 'Point', coordinates: [0, 0]}).not.toBeAnyGeometry 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).not.toBeAnyGeometry()[22m | ||
exports[`Error Snapshot Testing. Throws error: Invalid input to matcher 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeAnyGeometry()[22m | ||
Expected input to not be a valid GeoJSON geometry object. | ||
Argument must be a GeoJSON Geometry object. | ||
Received: [31m{\\"coordinates\\": [0, 0], \\"type\\": \\"Point\\"}[39m" | ||
Received: [31mfalse[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect(false).toBeAnyGeometry 1`] = ` | ||
exports[`Error Snapshot Testing. Throws error: Rejects Feature objects 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeAnyGeometry()[22m | ||
Argument must be a GeoJSON Geometry object. | ||
Must have a type property with value 'Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon', or 'GeometryCollection'. | ||
Received: [31mfalse[39m" | ||
Received: [31m{\\"geometry\\": {\\"coordinates\\": [102, 0.5], \\"type\\": \\"Point\\"}, \\"type\\": \\"Feature\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Rejects Feature objects 2`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeAnyGeometry()[22m | ||
Must have a type property with value 'Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon', or 'GeometryCollection'. | ||
Received: [31m{\\"features\\": [{\\"geometry\\": {\\"coordinates\\": [102, 0.5], \\"type\\": \\"Point\\"}, \\"properties\\": {\\"prop0\\": \\"value0\\"}, \\"type\\": \\"Feature\\"}, {\\"geometry\\": {\\"coordinates\\": [[102, 0], [103, 1], [104, 0], [105, 1]], \\"type\\": \\"LineString\\"}, \\"properties\\": {\\"prop0\\": \\"value0\\", \\"prop1\\": 0}, \\"type\\": \\"Feature\\"}, {\\"geometry\\": {\\"coordinates\\": [[[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]], \\"type\\": \\"Polygon\\"}, \\"properties\\": {\\"prop0\\": \\"value0\\", \\"prop1\\": {\\"this\\": \\"that\\"}}, \\"type\\": \\"Feature\\"}], \\"type\\": \\"FeatureCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Valid use case passes 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).not.toBeAnyGeometry()[22m | ||
Expected input to not be a valid GeoJSON geometry object. | ||
Received: [31m{\\"coordinates\\": [0, 0], \\"type\\": \\"Point\\"}[39m" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters