Skip to content

vue-test-utils v1.0.0-beta.22 broke my tests #877

Closed
@sobolevn

Description

@sobolevn

Version

1.0.0-beta.22

Reproduction link

wemake-services/wemake-vue-template#688

Steps to reproduce

  1. create a store
  2. mount a component with a store
  3. try to access a store on a instance of vm

What is expected?

I expect that everything will still be working as it used to

What is actually happening?

I does not work. Raising this error:

RUNS  ...
  ● unit tests for Comment component › should increment rating
    TypeError: Cannot read property 'commit' of undefined
      55 |     const wrapper = mount(Comment, { store, localVue, propsData: { comment } })
      56 | 
    > 57 |     wrapper.vm.$store.commit(types.UPDATE_RATING, {
         |                       ^
      58 |       commentId: comment.id,
      59 |       delta
      60 |     })
      at Object.test (tests/components/comment.spec.js:57:23)

Here's the full test code: https://github.com/wemake-services/wemake-vue-template/blob/master/template/tests/components/comment.spec.js#L53-L68

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions