MessageComponent.props() causes issue.
roymath-zz opened this issue · 2 comments
roymath-zz commented
The tests fail when doing a clean install and test.. the following changes seem to fix the issue (borrowed from the vue-test-utils-mocha-webpack-example)
modified test/MessageToggle.spec.js
@@ -8,8 +8,8 @@ describe('MessageToggle.vue', () => {
const button = wrapper.find('#toggle-message')
button.trigger('click')
const MessageComponent = wrapper.find(Message)
- expect(MessageComponent.props()).toEqual({msg: 'message'})
+ expect(MessageComponent.hasProp('msg', 'message')).toBe(true)
button.trigger('click')
- expect(MessageComponent.props()).toEqual({msg: 'toggled message'})
+ expect(MessageComponent.hasProp('msg', 'toggled message')).toBe(true)
eddyerburgh commented
Thanks for the issue 🙂
The problem was the package-lock was using beta.1 which didn't have the props method, I've bumped the version to beta.8
roymath-zz commented
Much appreciated.. love jest for vue testing (and it even renders nicely in an emacs term buffer)