-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change tests accordingly so they will pass
Most of them were achieved by a dirty hack: by changing `toBe(true)` to be `toBeFalsy()` and vice versa. The negation of truthiness is because if connection can be established, we return 0, which is falsy. Otherwise we return an error enum which is truthy. This is a bit C-esque and not JS-y, but let's keep it this way as of now. Throw-catch would technically work, but it's not technically an error because we are **testing** if a connection can be established. Returning an error would also technically work, and we can add some type matching to make it work more smoothly, but as of now I intend to keep it this way. One WIP would be to change `toBeTruthy` to the actual error code, but then some tests might break. We will need to investigate instead of coding tests based on the results.
- Loading branch information
Showing
4 changed files
with
38 additions
and
48 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