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

Mwpw 155418 Remove dependency on gist.github.com for gist.test.js #3549

Conversation

skholkhojaev
Copy link
Contributor

Description

This PR removes the dependency on gist.github.com in gist.test.js. Previously the test was reliant on external servers, which could lead to flaky tests and slower execution times.
Now the test now mocks the script creation process, to simulate the gist data locally without doing network calls.

Changes

  • Added sinon for stubbing document.createElement to mock script elements.
  • Added beforeEach and afterEach hooks to handle stubbing and restoring.

Resolves: MWPW-155418

Test URLs:

Copy link
Contributor

aem-code-sync bot commented Jan 27, 2025

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.48%. Comparing base (f5205a6) to head (2124543).
Report is 18 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #3549      +/-   ##
==========================================
- Coverage   96.49%   96.48%   -0.01%     
==========================================
  Files         260      260              
  Lines       60730    60808      +78     
==========================================
+ Hits        58599    58673      +74     
- Misses       2131     2135       +4     

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

@skholkhojaev skholkhojaev requested a review from mokimo January 27, 2025 12:35
@skholkhojaev skholkhojaev requested a review from mokimo January 29, 2025 12:21
@milo-pr-merge milo-pr-merge bot merged commit c12af33 into adobecom:stage Jan 30, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants