Closed devmontini closed 1 year ago
thank you for your PR.
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.
Sure, I'll take a look and try to troubleshoot the issues. No problem!
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