You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test beginners, may I ask how to simulate the internal methods of components,I call method a of a component, and then a will call method b of the same component or method c of a sub component. In this case, I need to simulate method b or method c. After simulating, I also assert that the simulation has been successful. However, if I call method a again at this time, it will still go to the original implementation of method b or method c。
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Test beginners, may I ask how to simulate the internal methods of components,I call method a of a component, and then a will call method b of the same component or method c of a sub component. In this case, I need to simulate method b or method c. After simulating, I also assert that the simulation has been successful. However, if I call method a again at this time, it will still go to the original implementation of method b or method c。
For example, if I want to simulate the successful call of foo1 here and only focus on foo2 itself, how should I write it
Example address:https://stackblitz.com/edit/vitest-dev-vitest-haltys?file=package.json
Can you please teach me
Beta Was this translation helpful? Give feedback.
All reactions