-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Added unit tests for fetcher, checker and matchers packages #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the contribution!
I've removed the "closes" tag in the description as it partially completes that issue.
@eisandbar looks like there are some lint issues. Could you check em out. After that, we're good to go |
Hi! I fixed the lint errors and running golangci-lint v1.48.0 on my computer shows no errors, but the lint action still fails on the same files. |
@eisandbar could you rebase? The lint issue should be resolved now |
Added unit tests for the 3 functions in matchers.go
Changed checker to accept interface of type Fetcher for easier mocking. Added tests for all the possible errors that could happen in Check
Refactored fetcher to use fetcher.sendRequest instead of hclient.Do for easier testing. Added tests for fetch function for all possible errors
Fixed lint issues associated with return statements
@preslavmihaylov Yes, no problem |
As issue #173 is pretty broad I decided to first work on part of it.
Did slight refactoring in fetcher.go for easier testing and added tests for all possible errors in Fetch()
Checker now accepts interface of type Fetcher for easier mocking. Added tests for all possible errors in Check()
Added tests for all 3 functions in matchers.go. Tests use supportedMatchers for test cases so updating supportedMatchers should update tests.
go test -cover now shows 100% for these 3 files