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

Remove dependency axios-mock-adapter and fix the token unit tests #5369

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

openverse-bot
Copy link
Collaborator

@openverse-bot openverse-bot commented Feb 3, 2025

Edit: Originally, this was a renovate PR to update a dependency. However, this dependency was added to be used in the api-token tests, which were disabled during the Nuxt 3 migration, and wan't used in the codebase.

Instead of updating axios-mock-adapter, I removed it here and fixed the api-token unit tests.

This PR contains the following updates:

Package Type Update Change
axios-mock-adapter dependencies major ^1.22.0 -> ^2.0.0

Release Notes

ctimmerm/axios-mock-adapter (axios-mock-adapter)

v2.1.0

Compare Source

  • Migrate to modern js https://github.com/ctimmerm/axios-mock-adapter/pull/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

v2.0.0

Compare Source

Breaking Changes 💥
  • Drop node versions lower than v18 (https://github.com/ctimmerm/axios-mock-adapter/pull/390)

  • Change the parameters of the methods to align it to the one of axios. (https://github.com/ctimmerm/axios-mock-adapter/pull/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"}


Configuration

📅 Schedule: Branch creation - "* 0-3 1 * *" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@openverse-bot openverse-bot requested a review from a team as a code owner February 3, 2025 08:39
@openverse-bot openverse-bot added dependencies Pull requests that update a dependency file 💻 aspect: code Concerns the software code in the repository 🟨 tech: javascript Involves JavaScript 🟩 priority: low Low priority and doesn't need to be rushed labels Feb 3, 2025
@openverse-bot openverse-bot requested a review from obulat February 3, 2025 08:39
@openverse-bot openverse-bot added 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🧱 stack: frontend Related to the Nuxt frontend labels Feb 3, 2025
@openverse-bot openverse-bot requested a review from dhruvkb February 3, 2025 08:39
Copy link

github-actions bot commented Feb 3, 2025

Latest k6 run output1

     ✓ status was 200

     checks.........................: 100.00% ✓ 408      ✗ 0   
     data_received..................: 96 MB   397 kB/s
     data_sent......................: 53 kB   222 B/s
     http_req_blocked...............: avg=36.27µs  min=2.4µs    med=4.66µs   max=1.43ms   p(90)=145.03µs p(95)=163.13µs
     http_req_connecting............: avg=20.08µs  min=0s       med=0s       max=242.69µs p(90)=95.55µs  p(95)=113.04µs
     http_req_duration..............: avg=159.17ms min=19.01ms  med=107.18ms max=1.08s    p(90)=342.43ms p(95)=459.69ms
       { expected_response:true }...: avg=159.17ms min=19.01ms  med=107.18ms max=1.08s    p(90)=342.43ms p(95)=459.69ms
   ✓ http_req_failed................: 0.00%   ✓ 0        ✗ 408 
     http_req_receiving.............: avg=159.16µs min=48.77µs  med=138.66µs max=967.02µs p(90)=237.13µs p(95)=316.62µs
     http_req_sending...............: avg=31.82µs  min=7.01µs   med=22.67µs  max=3.16ms   p(90)=35.88µs  p(95)=40.36µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=158.98ms min=18.88ms  med=106.99ms max=1.08s    p(90)=342.17ms p(95)=459.24ms
     http_reqs......................: 408     1.694615/s
     iteration_duration.............: avg=861.64ms min=327.45ms med=910.07ms max=1.8s     p(90)=1.13s    p(95)=1.5s    
     iterations.....................: 76      0.315664/s
     vus............................: 2       min=0      max=6 
     vus_max........................: 60      min=60     max=60

Footnotes

  1. This comment will automatically update with new output each time k6 runs for this PR

@obulat obulat changed the title Update dependency axios-mock-adapter to v2 Remove dependency axios-mock-adapter and fix the token unit tests Feb 5, 2025
@obulat obulat force-pushed the gha-renovateaxios-mock-adapter-2.x branch from 5015a6c to edabb80 Compare February 5, 2025 11:00
@openverse-bot
Copy link
Collaborator Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@obulat obulat merged commit 236d816 into main Feb 5, 2025
48 checks passed
@obulat obulat deleted the gha-renovateaxios-mock-adapter-2.x branch February 5, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository dependencies Pull requests that update a dependency file 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: frontend Related to the Nuxt frontend 🟨 tech: javascript Involves JavaScript
Projects
Status: 🤝 Merged
Development

Successfully merging this pull request may close these issues.

2 participants