Open hauleth opened 7 years ago
Hi @hauleth .
Personally I'm not a fan of chaining methods, but I can be convinced. If other users would benefit from this feature, then I would be happy to accept a PR implementing the changes
The whole point is to have immutable wrappers in future that would allow writing code like:
const wrapper = mount(Hello)
it('contains default greeting', () => {
expect(wrapper.text()).toBe('Hello World!')
})
it('contains value of `greeting` prop', () => {
expect(wrapper.setProps({greeting: 'Witaj Świecie!'}).text()).toBe('Witaj Świecie!')
})
Instead of creating new wrapper inside each test.
This would allow chaining methods in tests and in future would simplify migration to immutable
VueWrapper
.Example:
Could be written as: