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
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
-
Hi!
vitest
andreact-testing-library
so I don't understand everything very well yet.I am testing a component that uses
useMatch
where a button must be disabled if we match the expected path ('/id/:wikiId/page/create'
).I wrote two ways of testing it with
spyOn
and withvi.hoisted / vi.mocked
that are working but don't understand why.Component
First with
SpyOn
Then with
vi.hoisted
andvi.mocked
Questions
useMatch
? SpyOn, vi.mocked or something else ?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions