You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks to Eddyyerburgh's help.But I still have problems after trying:
This is my package file:
This is my import file:
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.
The text was updated successfully, but these errors were encountered:
First of all, thanks to Eddyyerburgh's help.But I still have problems after trying:
This is my package file:
This is my import file:
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.
The text was updated successfully, but these errors were encountered: