Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: throw errors in setData and setProps for functional components #438

Merged
merged 2 commits into from
Feb 21, 2018

Conversation

eddyerburgh
Copy link
Member

@eddyerburgh eddyerburgh commented Feb 21, 2018

  • Throw errors in setData and setProps when component is functional

setData can never work on a functional component. setProps could work, but will require a lot of code changes. In the meantime, we should throw an error instead of letting it fail silently

#402

@eddyerburgh eddyerburgh merged commit 619f934 into vuejs:dev Feb 21, 2018
@eddyerburgh eddyerburgh deleted the set-props-functional branch February 21, 2018 20:08
@dimensi
Copy link

dimensi commented Mar 23, 2018

@eddyerburgh I get instead of a human readble error, I get


    TypeError: Cannot read property 'includes' of undefined

      29 |       default: [componentFirst(), componentSecond()],
      30 |     })
    > 31 |     wrapper.setProps({
      32 |       text: testText,
      33 |     })
      34 |     expect(wrapper.isVueInstance()).toBe(true)

      at node_modules/@vue/test-utils/dist/vue-test-utils.js:1378:39
          at Array.forEach (<anonymous>)
      at VueWrapper.setProps (node_modules/@vue/test-utils/dist/vue-test-utils.js:1375:21)
      at Object.test (tests/VueSprintfComponents.test.js:31:13)

@eddyerburgh
Copy link
Member Author

This hasn't been released yet. Once it's released in beta.13 you should get a human readable error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants