Documentation > "Cookbook" > "Testing "> "Unit testing a store" doesn't have a working test #2066
Unanswered
DanFMoore
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I tried raising this as a bug, but since it's a bug with the documentation and not the codebase, I couldn't provide a working js fiddle link.
Steps to reproduce the bug:
Create a file called
stores/counter.spec.ts
based on the code sample on https://pinia.vuejs.org/cookbook/testing.html#unit-testing-components. This importsuseCounter
from "../src/stores/counter". There is no such file or source code thereof provided anywhere in the documentation that works for that unit test.Expected behaviour:
There should be an easily referenced source code file on the same documentation page which contains the code to be unit tested, a function called
useCounter
.Actual behaviour:
There is no such easily referenced source code file containing the function
useCounter
. There are several implementations ofuseCounterStore
provided in the "Core Concepts" section of the documentation e.g. on https://pinia.vuejs.org/core-concepts/state.html but even accounting for the difference in function name, the unit test does match any of these.Beta Was this translation helpful? Give feedback.
All reactions