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

setData() | right-hand side of 'in' should be an object, got null #888

Closed
reginsmol opened this issue Aug 1, 2018 · 0 comments
Closed
Labels

Comments

@reginsmol
Copy link

reginsmol commented Aug 1, 2018

Version

1.0.0-beta.22

Reproduction link

https://github.com/reginsmol/test-utils-setdata-reproduction

Steps to reproduce

  1. npm install
  2. npm run dev
  3. npm run unit

What is expected?

setData() should set the data property to the new value passed in.

What is actually happening?

Throws errors:

TypeError: Cannot use 'in' operator to search for 'key' in null
           at VueComponent.set [as $set] (webpack:///node_modules/vue/dist/vue.esm.js:1035:0 <- index.js:1195:11)
           at webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1152:0 <- index.js:12632:10
           at Array.forEach (<anonymous>)
           at recursivelySetData (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1147:0 <- index.js:12627:20)
           at webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1150:0 <- index.js:12630:7
           at Array.forEach (<anonymous>)
           at recursivelySetData (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1147:0 <- index.js:12627:20)
           at VueWrapper.setData (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1644:0 <- index.js:13124:3)
           at Context.<anonymous> (webpack:///test/unit/specs/HelloWorld.spec.js:9:12 <- index.js:11445:13)

right-hand side of 'in' should be an object, got undefined
       set@webpack:///node_modules/vue/dist/vue.esm.js:1035:0 <- index.js:1195:1
       recursivelySetData/<@webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1152:0 <- index.js:12640:7
       recursivelySetData@webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1147:0 <- index.js:12635:3
       recursivelySetData/<@webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1150:0 <- index.js:12638:7
       recursivelySetData@webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1147:0 <- index.js:12635:3
       setData@webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.js:1644:0 <- index.js:13132:3
       @webpack:///test/unit/specs/HelloWorld.spec.js:18:4 <- index.js:11453:5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants