Skip to content

Conversation

@sunil-lakshman
Copy link
Contributor

snyk-top-banner

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.


⚠️ Warning: This PR contains major version upgrade(s), and may be a breaking change.

  • 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

    Breaking 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"}

  • 1.22.0 - 2023-09-11
    • Helper for delay in milliseconds (#312)
      mock.delayInMs(200).onGet("/foo").reply(200);
      mock.delayInMs(0).onGet("/bar").reply(200);
from axios-mock-adapter GitHub release notes

Important

  • Warning: This PR contains a major version upgrade, and may be a breaking change.
  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

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:

Snyk has created this PR to upgrade axios-mock-adapter from 1.22.0 to 2.1.0.

See this package in npm:
axios-mock-adapter

See this project in Snyk:
https://app.snyk.io/org/contentstack-devex/project/e103abcf-6a71-475f-a1f3-1334c876870c?utm_source=github&utm_medium=referral&page=upgrade-pr
@sunil-lakshman sunil-lakshman requested a review from a team as a code owner January 16, 2025 00:51
@github-actions
Copy link

Coverage report

Caution

Coverage does not meet threshold
Statements coverage not met for global: expected >=95%, but got 94.53125%

St.
Category Percentage Covered / Total
🟢 Statements 94.53% 121/128
🟢 Branches 92.59% 75/81
🟢 Functions 100% 14/14
🟢 Lines 94.26% 115/122

Test suite run failed

Failed tests: 0/35. Failed suites: 0/5.

Report generated by 🧪jest coverage report action from 190b605

@github-actions
Copy link

Coverage report

Caution

Coverage does not meet threshold
Statements coverage not met for global: expected >=95%, but got 94.53125%

St.
Category Percentage Covered / Total
🟢 Statements 94.53% 121/128
🟢 Branches 92.59% 75/81
🟢 Functions 100% 14/14
🟢 Lines 94.26% 115/122

Test suite run failed

Failed tests: 0/35. Failed suites: 0/5.

Report generated by 🧪jest coverage report action from 190b605

@cs-raj
Copy link
Contributor

cs-raj commented Jan 18, 2025

closing the pr since the latest version is added

@cs-raj cs-raj closed this Jan 18, 2025
@cs-raj cs-raj deleted the snyk-upgrade-0b0d1f6169fc028d058a71c5861506cf branch January 18, 2025 08:29
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.

4 participants