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

Merged
merged 3 commits into from
Jan 18, 2025
Merged

Deprecate ctMock.add() #246

merged 3 commits into from
Jan 18, 2025

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

Copy link

changeset-bot bot commented Oct 22, 2024

🦋 Changeset detected

Latest commit: d3e8977

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

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
@mvantellingen mvantellingen merged commit 1b73792 into main Jan 18, 2025
9 checks passed
@mvantellingen mvantellingen deleted the feature/deprecation branch January 18, 2025 18:48
@github-actions github-actions bot mentioned this pull request Jan 18, 2025
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