Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

I could successfully migrate my Angular 20/Jasmine/Karma app to Angula r21/Vitest All my tests are running correctly, except the ones that use debounceTime from RxJS As a workaround for now, ny unit ...
Advice
1 vote
1 replies
100 views

I am a bit confused with the Angular testing landscape. I have seen that Vitest will become the new default, replacing Karma. The question I then have is what about Jasmine. Does Vitest replace only ...
-1 votes
1 answer
76 views

I'm trying to have Vitest + Storybook setup and the following is my vitest.config.ts: import path from "path"; import { fileURLToPath } from "node:url"; import { defineConfig } ...
-4 votes
0 answers
52 views

I am using Vitest in browser mode, with Playwright as the provider. Whenever a test fails, a screenshot of the failed test is created in __screenshots__/<filename>/<test-name>. I am unsure ...
12 votes
2 answers
14k views

I'm in a Vite/React/TypeScript application and I'm configuring my first test with Vitest. When I run my Button test (yarn vitest), I get this error: packages/frontend/src/components/Generic/Button/...
4 votes
3 answers
1k views

I'm migrating from jest to vitest. In the process, I am converting these: // Jest const myLib = jest.requireActual("mylib.js") to these: // Vitest const myLib = await vi.importActual("...
0 votes
2 answers
94 views

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 ...
-1 votes
1 answer
57 views

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 ...
0 votes
0 answers
19 views

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 ...
0 votes
1 answer
90 views

I’m trying to run Vitest with the UI enabled using: "scripts": { "test:ui": "vitest --ui" } When I run it with: npm run test:ui I get the following error: Error: ...
1 vote
2 answers
142 views

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 ...
7 votes
2 answers
3k views

I'm trying the in-source testing of vitest. Here is the example given by the doc: if (import.meta.vitest) { const { it, expect } = import.meta.vitest; it('add', () => { expect(1 + 1).toBe(2)...
-4 votes
1 answer
66 views

When I use: describe("ExtractDateFromText", () => { test.for(scannedReceiptText)('Filename %s', async (expected) => { const dateResult = dateFromRawData(...
1 vote
1 answer
2k views

When using vitest to test a UI, I'm trying to do a screen.getBy.. that fails. When it fails, I see the rendered HTML as a log, but it cuts off abruptly so that I can't see the elements that actually ...
0 votes
1 answer
87 views

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 ...
1 vote
1 answer
51 views

In my snapshot, I have objects of the following format: { "meanElements": { "Om": 2.2835713400168607, "am": 1.3043985097733939, "em": 0.166565, ...
1 vote
1 answer
2k views

we got a Vue application which calls an api endpoint using vueuses useFetch. It is tested with Vitest and msw (mock service worker) to check our API calls. Our code looks like the following: // api.ts ...
1 vote
1 answer
123 views

I am using vitest with vitest-plugin-vis and playwright to perform visual testing in my Vite project. The issue I am facing is that the snapshots that are generated are only capturing part of my ...
1 vote
1 answer
60 views

This problem happens in testing environments. when I try to import an enum from @prisma/client it returns undefined... import { DailyTip } from "@prisma/client"; describe("test", (...
11 votes
12 answers
21k views

I am new to testing and I was trying to use vitest for testing my mern social media app. looking for references to test a react component using vitest i found this article https://eternaldev.com/blog/...
2 votes
1 answer
3k views

When working on a test, I might run, and rerun it 100 times while stepping through in debug mode, refactoring and re-checking certain things, but vitest's default timeout period is only 5s, and vitest'...
0 votes
0 answers
56 views

I'm working on a Zod schema for nodes where each node got a unique ID, unique type and an array of child nodes. Because of that I created a helper function acting as a base schema for nodes function ...
0 votes
2 answers
623 views

Sorry if this seems really obvious, but I've been trying to figure out for two days now. I'm writing a simple unit test in vitest that renders a component to screen and then calling screen.debug(). ...
155 votes
20 answers
85k views

Trying to setup vitest on an already existing vite (vue 3, typescript) project. My vite.config.ts looks like this: import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; export ...
3 votes
1 answer
272 views

I have a Next.js app that is running without any errors. However, I am using Vitest for my testing framework and when running a specific test (layout.test.tsx) it produces this error: FAIL src/app/...

1
2 3 4 5
19