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

chore: improve testing server debug shim #1255

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

metal-messiah
Copy link
Member

The current logging shim output of the test server alters Ajax and resource payloads when enabled because it generates network requests to capture the log messages. This change introduces a global array that intercepts and stores log messages in it that can be fetched on the fly with a browser execute statement.

Overview

An example of how to use this would be something like:

  1. anywhere in your test add the included helper method
    • console.log(await getDebugLogs())
      This will return the current state of the log message buffer. Anytime something like console.log is called in the test execution step (client side), the log buffer will be populated with the contents. You must start the test server with the -d flag as before for the shim to be injected into the page.

Related Issue(s)

Testing

Copy link

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 29.24 kB / 10.6 kB (gzip) 29.24 kB / 10.6 kB (gzip) 0% / 0% (gzip)
lite async-chunk 53.75 kB / 17.44 kB (gzip) 53.75 kB / 17.44 kB (gzip) 0% / 0% (gzip)
pro loader 50.3 kB / 17.39 kB (gzip) 50.3 kB / 17.39 kB (gzip) 0% / 0% (gzip)
pro async-chunk 99.99 kB / 30.5 kB (gzip) 99.99 kB / 30.5 kB (gzip) 0% / 0% (gzip)
spa loader 57.88 kB / 19.7 kB (gzip) 57.88 kB / 19.7 kB (gzip) 0% / 0% (gzip)
spa async-chunk 114.71 kB / 34.78 kB (gzip) 114.71 kB / 34.78 kB (gzip) 0% / 0% (gzip)

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (19cbb63) to head (0d1aa22).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1255   +/-   ##
=======================================
  Coverage   89.21%   89.21%           
=======================================
  Files         170      170           
  Lines        7331     7331           
  Branches     1476     1476           
=======================================
  Hits         6540     6540           
  Misses        671      671           
  Partials      120      120           
Flag Coverage Δ
unit-tests 79.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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


🚨 Try these New Features:

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.

1 participant