Maksim Nesterenko
Maksim Nesterenko

Reputation: 6213

How to get props of functional component with vue-test-utils

I can't just access props as wrapper.props() when I want to do that with functional component, so how can I access them?

Error: [vue-test-utils]: wrapper.props() cannot be called on a mounted functional 
component.

Upvotes: 1

Views: 3813

Answers (1)

Maksim Nesterenko
Maksim Nesterenko

Reputation: 6213

Found an answer right after asking: https://vue-test-utils.vuejs.org/api/wrapper/#attributes

Since functional is essentially a DOM node, so I should just get it's attributes (props are just attributes here)

Upvotes: 2

Related Questions