-
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(isValid2DCoordinate): add robust snapshot tests
Adds extensive snapshot testing to address #32.
- Loading branch information
1 parent
8a6e611
commit ae92f67
Showing
2 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
36 changes: 30 additions & 6 deletions
36
tests/coordinates/__snapshots__/isValid2DCoordinate.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,42 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect([0, 0]).not.isValid3DCoordinate 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).not.isValid2DCoordinate()[22m | ||
exports[`Error Snapshot Testing. Throws error: Coordinate latitude must be a number between -90 and 90 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).isValid2DCoordinate()[22m | ||
Expected input to not be a two element array with longitude between (-90 to 90), | ||
and latitude between (-180 to 180). | ||
Coordinate latitude must be a number between -90 and 90. | ||
Received: [31m[0, 0][39m" | ||
Received: [31m[0, 100][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Coordinate longitude must be a number between -180 and 180 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).isValid2DCoordinate()[22m | ||
Coordinate longitude must be a number between -180 and 180. | ||
Received: [31m[-256, 0][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Coordinate must be an array of only two elments 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).isValid2DCoordinate()[22m | ||
Coordinate must be an array of only two elments. | ||
Received: [31m[0, 0, 733][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect(false).isValid2DCoordinate() 1`] = ` | ||
exports[`Error Snapshot Testing. Throws error: Invalid input to matcher 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).isValid2DCoordinate()[22m | ||
Coordinate must be an array of only two elments. | ||
Received: [31mfalse[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Valid use case passes 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).not.isValid2DCoordinate()[22m | ||
Expected input to not be a two element array with longitude between (-90 to 90), | ||
and latitude between (-180 to 180). | ||
Received: [31m[0, 0][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