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

vue-test-utils 1.0.0-beta.16 setData Error #181

Open
OneIsAll-L opened this issue May 29, 2018 · 0 comments
Open

vue-test-utils 1.0.0-beta.16 setData Error #181

OneIsAll-L opened this issue May 29, 2018 · 0 comments

Comments

@OneIsAll-L
Copy link

First of all, thanks to Eddyyerburgh's help.But I still have problems after trying:
This is my package file:

_20180529161016
This is my import file:
_20180529161304
And I tried two ways:
One kind
it('setData()方法', () => { const wrapper = mount(Counter) wrapper.setData({foo: 'bar'}) expect(wrapper.data().foo).to.equal('bar') })
The other
it('setData()方法', () => { const wrapper = mount(Counter) wrapper.setData({foo: 'bar'}) expect(wrapper.vm.foo).to.equal('bar') })
However, it still prompts different errors:
The first erroris: TypeError: wrapper.data is not a function
at Context. (webpack:///test/unit/specs/Counter.spec.js:81:19 <- index.js:12255:20)
The second:AssertionError: expected undefined to equal 'bar'
at Context. (webpack:///test/unit/specs/Counter.spec.js:81:30 <- index.js:12255:31)

I hope to find the cause of the problem and solve it as soon as possible with your help.

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

No branches or pull requests

1 participant