can't spy on nested function call #2408
Unanswered
lkurylo
asked this question in
Help and Questions
Replies: 1 comment
-
The problem is that helper is the actual function within the store, not the spy. The spies are useful outside of the store only. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a simple store:
I want to test if helper() method is being called on calculate() execution, so created a unit test with configuration:
I tthrows exception on last expect:
expected spy to be called once but got 0 times
Here is a link with reproduction: https://stackblitz.com/edit/vitest-dev-vitest-lyex7t?file=test%2FuseFormsContextStore.test.ts
Don't know where the problem is?
Beta Was this translation helpful? Give feedback.
All reactions