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

Deprecate ctMock.add() #246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Deprecate ctMock.add() #246

wants to merge 2 commits into from

Conversation

mvantellingen
Copy link
Member

@mvantellingen mvantellingen commented Oct 22, 2024

The ctMock.add() function directly inserts objects in the in-memory store of commercetools mock, which could result in invalid objects being processed due to missing validation, or pre processing hooks.

This change introduces a new method unsafeAdd() to still have this option available while clearly signalling you shouldn't normally use it.

Note that this for now only shows a deprecation warning, the functionality will still be there for the foreseeable future

Move away from console.warn and instead use the official api
The `ctMock.add()` function directly insert objects in the in-memory
store of commercetools mock, which could result in invalid objects being
processed
Copy link

changeset-bot bot commented Oct 22, 2024

🦋 Changeset detected

Latest commit: 0c33913

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@labdigital/commercetools-mock Minor

Not sure what this means? Click here to learn what changesets are.

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

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.

1 participant