Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/fix: Added test coverage and made fixed to getRoughCompassDirection #300

Merged
merged 6 commits into from
Jun 1, 2023

Conversation

ddarren
Copy link
Contributor

@ddarren ddarren commented May 31, 2023

Hey guys, thought I chip in and add some test coverage. Along way I encountered what seemed to be a bug and fixed that. Please let me know of any changes that should made.

Add test coverage to the following files:

  • findNearest.ts
  • getRoughCompassDirection.ts
  • isValidLatitude.ts
  • isValidLongitude.ts
  • toDeg.ts
  • toRad.ts

Made fixes to src/getRoughCompassDirection.ts:

What was happening here was the Regular expression would validate as true if string contained the value rather than matched exactly with value. For example, /^NNE|NE|NNW|N$/ would return N for ENE because ENE contains NE. The fix was to alter the regex so it performs a strict match rather than "contains".

@manuelbieh manuelbieh merged commit 628c801 into manuelbieh:master Jun 1, 2023
@manuelbieh
Copy link
Owner

🎉 This PR is included in version 3.3.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ddarren ddarren deleted the ds-test-coverage branch June 1, 2023 15:44
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants