Skip to content

Bug: Stubs broken in vue@3.4.22 #2411

@alecgibson

Description

@alecgibson

Describe the bug

vue@3.4.22 added stricter type checking for event handlers, enforcing that they're either a Function or Function[], and not a string.

@vue/test-utils actively sets handlers to the string "[Function]", resulting in a warning:

      Error: Wrong type passed as event handler to onLeave - did you forget @ or : in front of your prop?
      Expected function or array of functions, received type string.at <Transition>

To Reproduce

https://stackblitz.com/edit/github-tyybbg?file=src%2Fcomponents%2FWelcomeItem.vue

npm i && npm run test:unit

Expected behavior

No warnings.

Related information:

  System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.61 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  npmPackages:
    @vue/test-utils: ^2.4.5 => 2.4.5 
    vue: ^3.4.22 => 3.4.22 

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy