[code-infra] Add utility to dump html from tests to file#1110
Open
[code-infra] Add utility to dump html from tests to file#1110
Conversation
Bundle size report
Check out the code infra dashboard for more information about this PR. |
brijeshb42
reviewed
Feb 19, 2026
| * created inside `test/html-dumps/` using the provided `fileName` (or a timestamp). | ||
| * @param options.fileName - Name of the file (without extension) when `filePath` is not set. | ||
| */ | ||
| export function dumpHTML({ |
Member
Author
There was a problem hiding this comment.
I thought about it, but the sync version can be used in any function, while an async version would need the entire tree to be async.
Since this is to be used just to test and not in regular code, I thought it wasn't necessary for it to be async
Janpot
reviewed
Feb 19, 2026
| * created inside `test/html-dumps/` using the provided `fileName` (or a timestamp). | ||
| * @param options.fileName - Name of the file (without extension) when `filePath` is not set. | ||
| */ | ||
| export function dumpHTML({ |
Member
There was a problem hiding this comment.
Suggestion: Stay analog to the screen.debug() signature. And avoid conflicting params
await dumpHTML()
await dumpHTML(document.body)
await dumpHTML(document.body, './file.html')
await dumpHTML(screen.getByText('Foo'))
await dumpHTML(screen.getByText('Foo'), './file.html')
await dumpHTML(screen.getByText('Foo'), path.resolve(process.cwd(), './file.html'))|
This pull request has been inactive for 30 days. Please remove the stale label or leave a comment to keep it open. Otherwise, it will be closed in 15 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates a new
dumpHTMLfunction in@mui/internal-test-utils