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

[Snyk] Upgrade axios-mock-adapter from 1.22.0 to 2.0.0 #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shafeeqd959
Copy link

snyk-top-banner

Snyk has created this PR to upgrade axios-mock-adapter from 1.22.0 to 2.0.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 1 version ahead of your current version.

  • The recommended version was released on 22 days ago.

Release notes
Package name: axios-mock-adapter
  • 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.0.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
Copy link

Coverage report

Caution

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

St.
Category Percentage Covered / Total
🟢 Statements 87.4% 111/127
🟢 Branches 82.05% 64/78
🟢 Functions 100% 14/14
🟢 Lines 86.78% 105/121

Test suite run failed

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

Report generated by 🧪jest coverage report action from 1f183fe

Copy link

Coverage report

Caution

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

St.
Category Percentage Covered / Total
🟢 Statements 87.4% 111/127
🟢 Branches 82.05% 64/78
🟢 Functions 100% 14/14
🟢 Lines 86.78% 105/121

Test suite run failed

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

Report generated by 🧪jest coverage report action from 1f183fe

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.

2 participants