Skip to content

Expose the wrapper instance in the render method #260

@elioschmutz

Description

@elioschmutz

Hey

Would be great having access to the underlying wrapper-object to get access to the vue-test-utils methods and properties.

Here is the diff that solved my problem:

diff --git a/node_modules/@testing-library/vue/dist/render.js b/node_modules/@testing-library/vue/dist/render.js
index b55fc18..5599956 100644
--- a/node_modules/@testing-library/vue/dist/render.js
+++ b/node_modules/@testing-library/vue/dist/render.js
@@ -80,6 +80,7 @@ function render(Component) {
   mountedWrappers.add(wrapper);
   container.appendChild(wrapper.element);
   return _objectSpread({
+    wrapper: wrapper,
     container: container,
     baseElement: baseElement,
     debug: function debug() {

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions