Skip to content

Documentation: error in the example 'Testing Actions' #192

@andrej-urvantsev

Description

@andrej-urvantsev

Disclaimer: I'm quite a newbie in the javascript world and especially in vue/vuex.

I believe this page has a mistake in the example:

 // check if no mutations should have been dispatched
  if (count === 0) {
    expect(expectedMutations.length).to.equal(0)
    done()
  }
}

If I understand it correctly this always should fail in case when you have async functions and expectedMutations.length>0 - there is a big chance that count is not updated at the moment of processing if (count === 0) condition.

Probably it should be something like

  // check if no mutations should have been dispatched
  if (expectedMutations.length === 0) {
    expect(count).to.equal(0);
    done();
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions