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

fix: mock properties of classes/functions (fix #1523) #1648

Merged
merged 1 commit into from Jul 16, 2022

Commits on Jul 15, 2022

  1. fix: mock properties of classes/functions (fix vitest-dev#1523)

    Previously classes weren't mocked properly because their prototypes were
    not being copied, so they lost all their methods. This commit rewrites
    the automocker to properly handle:
    
    - Functions with properties (namely classes)
    - Circular objects (also to handle classes, thanks JavaScript)
    
    With these changes classes can now be properly automocked!
    
    This fixes vitest-dev#1523.
    simon-abbott committed Jul 15, 2022
    Copy the full SHA
    1728548 View commit details
    Browse the repository at this point in the history