Skip to content

Feature: Debug with Watch #30

@benguenter

Description

@benguenter

Which feature do you want to improve?

Debug should be able to watch for dom changes, so that we can put debug at the beginning of the test, and then have the latest dom represented at time of failure.

What and why you want to improve that feature

This is useful so that we don't need to move the debug statement around as the test fails.
Additionally, this is useful when using things like the find* operators with testing library when it is polling for changes.
Or when debugging tests.

Potential bugs/ unexpected behaviors

Possible unexpected behavior if the two modes are mixed.
I.e. having this "watch debug" in one place, and then have a non-watch debug statement later on.

How to implement the changes

We could use a MutationObserver on the document element to watch for changes.

Something like this
image

Others

@nvh95 is this project still active? I'd love to open a PR for this feature, but it seems like there are a few PRs that have been open for a long time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions