Create Unit Test on Nuxt with vitest

Sample Code for Test – useCommonUtil.ts Here is a step to add unit test in Nuxt Project Setup For Test If you need to configure global settings (e.g., mocking or extending Jest matchers), create a vitest.setup.ts file Create a Test File create a test on the same level as useCommonUtil.ts > useCommonUtil.test.ts Run Tests Sample Run Result Reference








