Skip to content

Bug: expose props can not access in test case. #2116

Closed
@jason-chang

Description

@jason-chang

Describe the bug
defineExpose can works fine in the browser, but does not work in the test case.
Got error like ⬇️
image

To Reproduce
To reproduce this problem I created a demo and put it in the CodeSandbox.

The link is here ⬇️

https://codesandbox.io/p/github/jason-chang/test-utils-bug/main

Components in src/components/Case.vue
For test cases, see src/components/tests/case.test.tsx
The browse test code is in src/App.vue

Expected behavior

You want defineExpose exported projects to be properly accessible in both browser and test case.

Related information:

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