Skip to content

[Feature]: do not evaluate target module to infer its shape for auto-mock #1065

@escaton

Description

@escaton

What problem does this feature solve?

Allow auto-mocking modules that cannot be safely evaluated, e.g access browsers globals in module root.
Although, it can be fixed with proper testEnvironment, it is a compromise and also Vitest seems to solve it properly.

What does the proposed API look like?

No API change, just allow to rs.mock('I-will-call-DOM-immediately', {mock: true}) without evaluating it.

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