Skip to content

chore(cts): reuse method template #3385

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 11 commits into from
Jul 19, 2024
Merged

chore(cts): reuse method template #3385

merged 11 commits into from
Jul 19, 2024

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Jul 18, 2024

🧭 What and Why

We can reuse the method template in all languages, and for all tests suites, instead of copy pasting it 4 times.

Also simplify the logic and remove unused props, to make it more similar to the requests test suite

@millotp millotp self-assigned this Jul 18, 2024
@algolia-bot
Copy link
Collaborator

algolia-bot commented Jul 18, 2024

✔️ Code generated!

Name Link
🪓 Triggered by 3f3ab1eecb605a4564aa8b2c0dc3d5b5d09f2b6a
🍃 Generated commit 8c7127ce834517ec6e6ef79893d179563dd70788
🌲 Generated branch generated/chore/simplify-client-tests

@millotp millotp force-pushed the chore/simplify-client-tests branch from b228a59 to 27bccc5 Compare July 18, 2024 11:47
Copy link

github-actions bot commented Jul 18, 2024

@millotp millotp marked this pull request as ready for review July 18, 2024 14:44
@millotp millotp requested a review from a team as a code owner July 18, 2024 14:44
@millotp millotp requested review from morganleroi and shortcuts July 18, 2024 14:44
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

soooooooooo clean!!!

@@ -29,7 +29,7 @@ export function assertValidTimeouts(expectedCount: number): void {
expect(state.duration[0] * 2).to.be.closeTo(state.duration[1], 200);
break;
case 'Swift':
expect(state.duration[0]).to.be.closeTo(state.duration[1], 500);
expect(state.duration[0]).to.be.closeTo(state.duration[1], 800);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expect(state.duration[0]).to.be.closeTo(state.duration[1], 800);
expect(state.duration[0]).to.be.closeTo(state.duration[1], 9000);

let's preshot

@@ -140,7 +140,7 @@ When writing your template, here is a list of variables accessible from `mustach
"method": "the method to call on the API Client",
"testName": "the descriptive name test (default to `method`)",
"testIndex": "the index of the test to avoid duplicate function name",
"hasParameters": "true if the method has parameters, useful for `GET` requests",
"hasParams": "true if the method has parameters, useful for `GET` requests",
Copy link
Member

Choose a reason for hiding this comment

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

makes me think we should use a json schema here instead of json

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I can give it a try in another PR

@millotp millotp merged commit 484888b into main Jul 19, 2024
21 checks passed
@millotp millotp deleted the chore/simplify-client-tests branch July 19, 2024 07:27
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.

3 participants