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

tests + fix: #354 Add tests for OasstApiClient and fix handling of OasstError #447

Merged
merged 4 commits into from
Jan 6, 2023

Conversation

jack-michaud
Copy link
Collaborator

@jack-michaud jack-michaud commented Jan 6, 2023

Fixes #354

  • test: add unittest tests for edge cases in OasstApiClient
  • fix: handle OasstError correctly in OasstApiClient

try {
const error = JSON.parse(errorText);
throw new OasstError(error.message, error.error_code, resp.status);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out throwing an error in a try catch gets caught! smh.

@jack-michaud jack-michaud added the testing all things testing label Jan 6, 2023
@fozziethebeat fozziethebeat merged commit e8f160c into main Jan 6, 2023
@fozziethebeat fozziethebeat deleted the jm/tests-for-javascript-oasst-api-client branch January 6, 2023 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing all things testing website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write tests for JavaScript OasstApiClient
3 participants