Skip to content

cy.window().its( 'mw' ) is executing the inspect method on the subject #30662

Open
@micgro42

Description

@micgro42

Current behavior

The instruction

cy.window().its( 'mw' ).should( 'have.property', 'propertyToCheckFor' );

is executing the mw.inspect method if it exists.

That is fully unexpected and might lead to undefined behavior, including throwing an Exception and thus failing the test.

Desired behavior

The instruction

cy.window().its( 'mw' ).should( 'have.property', 'propertyToCheckFor' );

is not executing any methods of the window.mw object at all.

Test code to reproduce

https://github.com/micgro42/cypress-MFE-inspect

Cypress Version

13.16.0

Node version

v20.15.0

Operating System

Ubuntu 24.04.1

Debug Logs

GitHub complained that the comment is too long when I tried to add the entire debug output here. Please be more specific with what you need here. Alternatively, the debug output should be trivial to reproduce with the test code provided above.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    process: docsstaleno activity on this issue for a long period

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions