[Snyk] Upgrade axios-mock-adapter from 1.22.0 to 2.1.0 #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade axios-mock-adapter from 1.22.0 to 2.1.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 2 versions ahead of your current version.
The recommended version was released 3 months ago.
Release notes
Package name: axios-mock-adapter
-
2.1.0 - 2024-10-09
- Migrate to modern js #393
- ♻️ Migrate internal handler to an object
- ♻️ Migrate to ES2022
- ♻️ Migrate to Class
- ♻️ Migrate to async/await
- 🎁 Migrate handlers and history to a flat array. That way one only needs to check the history array to see all requests. The verbs on the array are still exposed, so there's no downside.
- 🎁 Add MockResponse types
-
2.0.0 - 2024-08-05
-
-
-
1.22.0 - 2023-09-11
- Helper for delay in milliseconds (#312)
from axios-mock-adapter GitHub release notesBreaking Changes 💥
Drop node versions lower than v18 (#390)
Change the parameters of the methods to align it to the one of axios. (#387)
The last parameter must be a config object with
{params, headers}instead of just the headers.If you've always only used two parameters, you won't have to change anything.
Methods with data param:
mock.onPost(url, data, headers)>mock.onPost(url, data, {params, headers})mock.onPut(url, data, headers)>mock.onPost(url, data, {params, headers})mock.onPatch(url, data, headers)>mock.onPatch(url, data, {params, headers})mock.onAny(url, data, headers)>mock.onAny(url, {data, params, headers})Methods without data param:
mock.onGet(url, {params}, headers)>mock.onGet(url, {params, headers})mock.onDelete(url, {params}, headers)>mock.onDelete(url, {params, headers})mock.onHead(url, {params}, headers)>mock.onHead(url, {params, headers})mock.onOptions(url, {params}, headers)>mock.onOptions(url, {params, headers})An error is reported if one accidentally passes the headers directly instead of `{headers: {}}.
e.g.
Error: Invalid config property Header-test provided to onPatch. Config: {"Header-test":"test-header"}Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: