-
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(toBeGeometryCollection): add robust snapshot tests, verify coord…
…inates treated as foreign member Adds extensive snapshot testing to address #32. Additionally added tests verifying that a "coordinates" member would get treated as a foreign member. No behavior had to change in the core function, but now this edge case is verified with testing. Resolves: #33
- Loading branch information
1 parent
df1c23a
commit 472d12d
Showing
2 changed files
with
136 additions
and
8 deletions.
There are no files selected for viewing
58 changes: 53 additions & 5 deletions
58
tests/geometries/__snapshots__/toBeGeometryCollection.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,65 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect({type: 'GeometryCollection', geometries: []}).not.toBeGeometryCollection 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).not.toBeGeometryCollection()[22m | ||
exports[`Error Snapshot Testing. Throws error: Bounding box must be valid 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
Expected input to not be a valid GeoJSON GeometryCollection object. | ||
Bounding box must be an array of either four or six elments. | ||
Received: [31m{\\"geometries\\": [], \\"type\\": \\"GeometryCollection\\"}[39m" | ||
Received: [31m{\\"bbox\\": [0], \\"geometries\\": [], \\"type\\": \\"GeometryCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Geometries not an array 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
Geometries property must be an array of valid GeoJSON geometry objects. | ||
Received: [31m{\\"geometries\\": false, \\"type\\": \\"GeometryCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Has forbidden property: features 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
GeoJSON Geometry objects are forbidden from having a property 'features'. | ||
Received: [31m{\\"features\\": null, \\"geometries\\": [], \\"type\\": \\"GeometryCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Has forbidden property: geometry 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
GeoJSON Geometry objects are forbidden from having a property 'geometry'. | ||
Received: [31m{\\"geometries\\": [], \\"geometry\\": null, \\"type\\": \\"GeometryCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect(false).toBeGeometryCollection() 1`] = ` | ||
exports[`Error Snapshot Testing. Throws error: Has forbidden property: properties 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
GeoJSON Geometry objects are forbidden from having a property 'properties'. | ||
Received: [31m{\\"geometries\\": [], \\"properties\\": null, \\"type\\": \\"GeometryCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Invalid input to matcher 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
Must have a type property with value 'GeometryCollection'. | ||
Received: [31mfalse[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Missing geometries property 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeGeometryCollection()[22m | ||
GeoJSON GeometryCollection must contain a 'geometries' with an array of GeoJSON geometries. | ||
Received: [31m{\\"type\\": \\"GeometryCollection\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Valid use case passes 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).not.toBeGeometryCollection()[22m | ||
Expected input to not be a valid GeoJSON GeometryCollection object. | ||
Received: [31m{\\"geometries\\": [], \\"type\\": \\"GeometryCollection\\"}[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