rajatjindal / goodfirstissue

webhook for goodfirstissue github app
https://github.com/apps/goodfirstissue
Apache License 2.0
31 stars 7 forks source link

Add unit tests for Tweet method in twitter.Client #33

Closed devmontini closed 1 year ago

devmontini commented 1 year ago

Updated Twitter client with enhanced error handling has been added along with three new test functions in this commit:

TestNewClient: checks if NewClient function can create a new client with test access tokens and ensures that the client is not nil. TestTweetSuccess: tests the Tweet function by creating a client with live access tokens, posting a tweet with the message "Hello, Twitter!", and checks that no errors occur. TestTweetError: tests the Tweet function by creating a client with live access tokens, posting a tweet with an empty message, and checks that an error of type ErrTweetFailed is returned.

PD: Furthermore, the Client struct has been updated to include an error return value for the Tweet function, which provides better error handling.

Issue: add unit tests for goodfirstissue #23

rajatjindal commented 1 year ago

thank you for your PR.

rajatjindal commented 1 year ago

Hi @devmontini I apologize, but I had to remove the test cases that were submitted as part of this PR. I was running into issues when running those locally. were you able to run these tests successfully on your laptop?

again apologies for that. once we sort this out, I am happy to include the tests back.

devmontini commented 1 year ago

Sure, I'll take a look and try to troubleshoot the issues. No problem!