Skip to content

feat(js): Cast tests with EchoResponse, improve JS template #87

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

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

shortcuts
Copy link
Member

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-250

Changes included:

Lots of changes, but it's mostly auto generated code, don't worry!

  • Provide EchoResponse type which allow casting the response in our CTS and remove use of the as any casts.
    • I was initially going to also test the type of the parameters, but due to serialization of the payload it adds a lot of logic for a not-that-necessary feature.
  • Remove any use of date-time in our specs
    • There's a lot of different date format handled in the REST API, which creates conditional templates, that are in the end stringified.
  • Remove use of the model/models.ts file, we only authenticate in headers so we can have a simple function in the class.
  • Fix response in the abtesting client (sorry it's out of the scope of this PR)

🧪 Test

@shortcuts shortcuts requested a review from a team January 13, 2022 16:23
@shortcuts shortcuts self-assigned this Jan 13, 2022
@shortcuts shortcuts requested review from damcou and removed request for a team January 13, 2022 16:23
@shortcuts
Copy link
Member Author

I still feel like having the method params generic would be better than casting, but I don't really want to impact the API for our own testing strategy

millotp
millotp previously approved these changes Jan 13, 2022
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

Looking really good !

Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

Magnificent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants