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

Throw an error when an unknown mutation is requested #1699

wants to merge 1 commit into
base: dev


Copy link

andrewminer commented Mar 19, 2020

I noticed when I was running my unit tests that I got a number of [vuex] unknown mutation type errors in the log, but without any tests actually failing. This was due to my having (deliberately) removed a store which provided those mutations. This also removed those tests which were explicitly exercising that mutation, so there were no longer any tests which actually checked that the mutation worked. So, that all checks out.

However... there still were all the the places which were calling the now unknown mutation without triggering any errors of their own in their tests. This pull request changes the reaction to not finding a mutation to thow an error instead of swallowing the problem. This will (correctly, to my mind) cause upstream code which erroneously commits a non-existant mutation to fail.

@andrewminer andrewminer force-pushed the andrewminer:andrewminer/throw-on-unknown-mutation branch from 210aede to 1360cf4 Mar 19, 2020
@andrewminer andrewminer force-pushed the andrewminer:andrewminer/throw-on-unknown-mutation branch from 1360cf4 to cc3be7c Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.