-
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.
refactor: modify valid 2D and 3D coordinate functions to throw errors…
… instead of return false This allows for more descriptive problems presented to the user when they run their tests with Jest. It sets up the standard going forward for how these tests should look. Subject to further refactoring in the future for the failMessage functions.
- Loading branch information
1 parent
9e49d3d
commit c0becfb
Showing
5 changed files
with
100 additions
and
62 deletions.
There are no files selected for viewing
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
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
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
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
9 changes: 5 additions & 4 deletions
9
tests/coordinates/__snapshots__/isValid3DCoordinate.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,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect([0, 0, 0]).not.isValid3DCoordinate 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).not.isValid3DCoordinate()[22m | ||
"[2mexpect([22m[31m[longitude, latitude, altitude][39m[2m).not.isValid3DCoordinate()[22m | ||
Expected input to not be a three element array with longitude between (-90 to 90) and latitude between (-180 to 180) and numeric altitude. | ||
Expected input to not be a three element array with longitude between (-90 to 90), | ||
latitude between (-180 to 180), and numeric altitude. | ||
Received: [31m[0, 0, 0][39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect([0, 0]).isValid3DCoordinate 1`] = ` | ||
"[2mexpect([22m[31m[longitude, latitude][39m[2m).isValid3DCoordinate()[22m | ||
"[2mexpect([22m[31m[longitude, latitude, altitude][39m[2m).isValid3DCoordinate()[22m | ||
Expected a three element array with longitude between (-90 to 90) and latitude between (-180 to 180) and numeric altitude. | ||
Input must be an array of only three elments. | ||
Received: [31m[0, 0][39m" | ||
`; |