Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 581 Bytes

README.md

File metadata and controls

20 lines (12 loc) · 581 Bytes

vitest-test

Project Setup

npm install
npm run test:unit

Details

This is a test repo to demonstrate mocked hooks. Check out the files HelloWorld.vue, HelloWorld.spec.ts, and useHook.ts.

In the test file I'm attempting to mock the useHook function which is imported from useHook.ts and use the factory funciton to provide new values.

When I console log useHook, I get undefined. This only happens when I'm using the factory function though. If the factory function is removed, I seem to get a mocked function, which is expected.