-
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(isValid2DBoundingBox): add robust snapshot tests
Adds extensive snapshot testing to address #32.
- Loading branch information
1 parent
7b4a804
commit 4363710
Showing
2 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
60 changes: 54 additions & 6 deletions
60
tests/boundingBoxes/__snapshots__/isValid2DBoundingBox.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,18 +1,66 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect([10, 10, 20, 20]).not.isValid2DBoundingBox 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).not.isValid2DBoundingBox()[22m | ||
exports[`Error Snapshot Testing. Throws error: Bounding box eastern value must be a number between -180 and 180 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Expected input to not be a four element array of numbers with longitude between (-90 to 90), | ||
latitude between (-180 to 180), and northern boundary greater than southern boundary. | ||
Bounding box western value must be a number between -180 and 180. | ||
Received: [31m[10, 10, 20, 20][39m" | ||
Received: [31m[10, 10, 200, 20][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect(false).isValid2DBoundingBox() 1`] = ` | ||
exports[`Error Snapshot Testing. Throws error: Bounding box must be an array of only four elments 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Bounding box must be an array of only four elments. | ||
Received: [31m[10, 10, 20, 20, 30][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Bounding box northern value must be a number between -90 and 90 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Bounding box northern value must be a number between -90 and 90. | ||
Received: [31m[10, 10, 20, 200][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Bounding box northern value must be greater than southern 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Bounding box northern value must be greater than southern. | ||
Received: [31m[10, 20, 20, 0][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Bounding box southern value must be a number between -90 and 90 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Bounding box southern value must be a number between -90 and 90. | ||
Received: [31m[10, -200, 20, 20][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Bounding box western value must be a number between -180 and 180 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Bounding box eastern value must be a number between -180 and 180. | ||
Received: [31m[200, 10, 20, 20][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Invalid input to matcher 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).isValid2DBoundingBox()[22m | ||
Bounding box must be an array of only four elments. | ||
Received: [31mfalse[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Valid use case passes 1`] = ` | ||
"[2mexpect([22m[31m[east, south, west, north][39m[2m).not.isValid2DBoundingBox()[22m | ||
Expected input to not be a four element array of numbers with longitude between (-90 to 90), | ||
latitude between (-180 to 180), and northern boundary greater than southern boundary. | ||
Received: [31m[10, 10, 20, 20][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