Skip to content

feat: use axios-mock-adapter for mocking axios requests - #2647

Merged
sanpj2292 merged 10 commits into
feat.add-comp-test-axios-mockingfrom
feat.use-axios-mock-adapter
Sep 27, 2023
Merged

sanpj2292 merged 10 commits into
feat.add-comp-test-axios-mockingfrom
feat.use-axios-mock-adapter

Conversation

@sanpj2292

@sanpj2292 sanpj2292 commented Sep 24, 2023 •

Copy link
Copy Markdown

Description of the change

Resolves INT-371

We are making use of axios-mock-adapter library to mock axios requests

  • migrate several destinations already in component test suite to this
  • migrate all user-deletion destinations to compnent test suite
  • remove global axios mock formation automatically
  • Corrected several user-deletion test-cases
  • Added support to apply mocks(both http requests, function) at test-case level

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

- migrate several destinations already in component test suite to this
- migrate all user-deletion destinations to compnent test suite
- remove global axios mock formation automatically
@sanpj2292
sanpj2292 requested review from a team and sivashanmukh as code owners September 24, 2023 20:46
@sanpj2292
sanpj2292 requested review from a team, shrouti1507 and ujjwal-ab and removed request for a team September 24, 2023 20:46
@codecov

codecov Bot commented Sep 25, 2023 •

Copy link
Copy Markdown

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (e7cfdf3) 86.89% compared to head (66b99dc) 86.95%.

Additional details and impacted files
@@                         Coverage Diff                          @@
##           feat.add-comp-test-axios-mocking    #2647      +/-   ##
====================================================================
+ Coverage                             86.89%   86.95%   +0.05%     
====================================================================
  Files                                   613      634      +21     
  Lines                                 28216    28302      +86     
  Branches                               6708     6711       +3     
====================================================================
+ Hits                                  24519    24609      +90     
+ Misses                                 3363     3359       -4     
  Partials                                334      334              
Files Coverage Δ
src/v0/destinations/canny/util.js 81.81% <100.00%> (ø)
src/v0/destinations/yahoo_dsp/util.js 90.00% <100.00%> (ø)
...tegrations/destinations/active_campaign/network.ts 100.00% <ø> (ø)
...t/integrations/destinations/af/deleteUsers/data.ts 100.00% <100.00%> (ø)
test/integrations/destinations/af/network.ts 100.00% <100.00%> (ø)
...t/integrations/destinations/am/deleteUsers/data.ts 100.00% <100.00%> (ø)
test/integrations/destinations/am/network.ts 100.00% <100.00%> (ø)
...ntegrations/destinations/braze/deleteUsers/data.ts 100.00% <100.00%> (ø)
test/integrations/destinations/braze/network.ts 100.00% <100.00%> (ø)
test/integrations/destinations/canny/network.ts 100.00% <ø> (ø)
... and 27 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sanpj2292 sanpj2292 self-assigned this Sep 25, 2023
Comment thread test/integrations/component.test.ts Resolved
@sanpj2292
sanpj2292 requested a review from koladilip September 26, 2023 07:08
Comment thread test/integrations/component.test.ts Resolved
@sanpj2292
sanpj2292 requested a review from koladilip September 27, 2023 07:05
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

86.5% 86.5% Coverage
0.0% 0.0% Duplication

@sanpj2292
sanpj2292 merged commit 53a9b5e into feat.add-comp-test-axios-mocking Sep 27, 2023
@sanpj2292
sanpj2292 deleted the feat.use-axios-mock-adapter branch September 27, 2023 11:03
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