When writing a Vitest config file in TypeScript, type errors don't seem to be caught. How to change that (and thus benefit from type checking if an option property is wrong)?Here's an example vitest....
I'm struggling to get Vitest (version ^3.2.4) to mock an ES6 class without type errors. This code compiles and works just fine if I use @ts-ignore or @ts-expect-error, but it is frustrating to leave ...
ProblemI have a Vue project that uses Vuex for state management. Parts of the Vuex store are often mocked in unit tests (Vitest).When Vuex stores are defined in both the main production code and in ...
I have a function that allows users to register. After successful registration, the user is redirected to the home page (after 5 seconds). Before being redirected, the user receives a toast ...
I'm testing components built with shadcn/ui, which uses Radix UI under the hood.When running UI interaction tests using Vitest and @testing-library/user-event, I keep getting the following error:...
I am struggling adding mocked methods when testing a Pinia store's functionality. There is very little documentation relating to actually testing the stores themselves, as most Pinia's official ...
In a large Vue 3 app, we have some helper modules that are imported into various components. One of these helpers returns the root node, which itself contains many other methods.In the app calls to ...
I have a Vite app and configured a domain - say https://abcd.io:5173 - as a domain and certificates are generated for this domain. Now I would like to use MSW for testing. But when I try to enable ...
I'm working on my portfolio site, and learning how to write TypeScript and test scripts. I'm stuck resolving these errors:RUN v3.2.4 /Users/sigma/Documents/Websites/Site/Site 5 ❯ tests/lightbox....
I’m trying to run Vitest with the UI enabled using:"scripts": { "test:ui": "vitest --ui"}When I run it with:npm run test:uiI get the following error:Error: ...
I want to run Vitest tests in a monorepo. I'd like to distinguish between the tests of my different packages when running them, so I used the test.projects array in vitest.config.ts. To avoid listing ...
I have a vitest test in the following form:beforeEach(async () => { // ???})describe('Subject Under Test', () => { test('should behave as expected', async () => { });});How ...
I’m trying to write a Vitest unit test for an auto-save feature in a Svelte 5 project.The test sets meta.settings.autoSaveIntervalMs = 50 so the save cycle finishes quickly, but the $effect still ...
I have this very persistent problem which is very strange to me. It actually happened in a larger project but I isolated it in a very minimal project setup and the error keeps happening, hopefully ...