commercetools / commercetools-sdk-typescript

The e-commerce SDK from commercetools for JavaScript written in TypeScript.
https://commercetools.github.io/commercetools-sdk-typescript/
MIT License
46 stars 25 forks source link

fix(tests): check before create new product type #796

Closed lojzatran closed 2 months ago

lojzatran commented 2 months ago

There was an issue that more than 1000 product types were created. This is the limit of CTP: https://docs.commercetools.com/api/limits#product-types. So, we need to ensure that the product type is created only if it does not exist. This PR checks if the product type exists before creating a new one.

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: ab80939a060c13fa056136077cd5fea1e94215c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.07%. Comparing base (a4fcf87) to head (ab80939). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #796 +/- ## ========================================== + Coverage 92.90% 93.07% +0.17% ========================================== Files 25 25 Lines 282 289 +7 Branches 12 14 +2 ========================================== + Hits 262 269 +7 Misses 20 20 ``` | [Flag](https://app.codecov.io/gh/commercetools/commercetools-sdk-typescript/pull/796/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools) | Coverage Δ | | |---|---|---| | [integrationtests](https://app.codecov.io/gh/commercetools/commercetools-sdk-typescript/pull/796/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools) | `93.07% <100.00%> (+0.17%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ajimae commented 2 months ago

Hi @lojzatran, can we get a description of what this PR or maybe what it is trying to achieve? Thanks

lojzatran commented 2 months ago

Hi @lojzatran, can we get a description of what this PR or maybe what it is trying to achieve? Thanks

Hi @ajimae, I added the description.