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 ...
Paulo Costa's user avatar
0 votes
1 answer
36 views

While I was able to get my C# code running in the browser as WebAssembly, I get errors like this when trying to run any (vitest) unit tests that load the module that initializes .NET: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯...
Qwertie's user avatar
  • 17.4k
-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 ...
Joe's user avatar
  • 409
0 votes
0 answers
55 views

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....
Quentin's user avatar
  • 1,173
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 ...
Clyde's user avatar
  • 62
0 votes
1 answer
43 views

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 ...
Vampuuri's user avatar
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 ...
Abhilash D K's user avatar
  • 1,329
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: ...
Cary Bondoc's user avatar
  • 3,016
0 votes
2 answers
120 views

I have a vitest test in the following form: beforeEach(async () => { // ??? }) describe('Subject Under Test', () => { test('should behave as expected', async () => { }); }); How ...
Noel Yap's user avatar
  • 19.9k
0 votes
2 answers
72 views

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 ...
henrymattel's user avatar
-2 votes
1 answer
233 views

I’m trying to separate my TypeScript test configs for a Vite + React + Vitest project. The tsconfig.app.json and tsconfig.node.json files were created automatically by Vite; I only added my own ...
Basma Khalil's user avatar
0 votes
1 answer
91 views

I'm trying to test (using Vitest) a part of my Fastify app that uses @fastify/websocket (and transitively ws), but my tests keep timing out despite running to completion. Here's a relevant excerpt ...
JesseTG's user avatar
  • 2,195
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 ...
MWB's user avatar
  • 1,899
0 votes
0 answers
178 views

I ran the following commands in sveltekit to create a new project npx sv create ch_ui I selected the following options ┌ Welcome to the Svelte CLI! (v0.8.20) │ ◇ Which template would you like? │ ...
PirateApp's user avatar
  • 6,362
0 votes
0 answers
248 views

I am using React version 19 with Vite and when run Vitest, it's giving error FAIL src/components/UserPopover/UserPopover.test.tsx > UserPopover > calls only onCancel when "Cancel&...
Anand Deep Singh's user avatar
0 votes
0 answers
30 views

I'm trying to test a simple Inertia.js + React component using Vitest and React Testing Library. The component uses useForm() from @inertiajs/react and the route() helper function from Ziggy (Laravel)....
desh's user avatar
  • 699
1 vote
1 answer
1k views

I have code in which setTimeout is called repeatedly. Essentially the callback of one setTimout sets another one and so forth. I’d like to test the delays with vi.useFakeTimers() so that the code is ...
zwirbeltier's user avatar
0 votes
1 answer
77 views

I was going over Road to React (the book by Robin Wieruch), and I encountered a confusing piece of code. The code is on the Testing chapter, page 227: describe('App', () => { it('succeeds ...
Taofeek's user avatar
  • 53
0 votes
0 answers
34 views

I have a Nuxt composable that fetches data from Contentful using the contentful client's getEntries function. It's working on the frontend of my website but when I run my tests i'm getting: TypeError: ...
user2953989's user avatar
  • 3,039
0 votes
1 answer
182 views

I have the following hook: function useWelcomeMessage() { const { data, error} = useGetWelcomeMessage(); const printMessage = useCallback(async () => { if (data) { alert(data) ...
Mark's user avatar
  • 2,031
1 vote
0 answers
44 views

I created a CLI with commander.js and I have some prompts like inputs etc. I want to test the prompts with unit testing, so for example to set a test value when a prompt is showing. So for example in ...
Jonathan Sigg's user avatar
0 votes
1 answer
69 views

I have a few commands with oclif whose tests fail with vitest but pass with jest. I believe something is off with the mocking. This is the structure: src/ commands/ foo-cmd.ts tests/ ...
gkri's user avatar
  • 2,041
1 vote
1 answer
153 views

I'm using an env variable MY_VAR that I use from $env/static/public import { MY_VAR } from '$env/static/public'; export const myVar = MY_VAR === 'true'; I'd like to mock it in some tests, to support ...
Valentin Vignal's user avatar
0 votes
0 answers
157 views

I am writing vitest tests that need http access to files in the public folder, which will be under the base url at production. What is a good way to accomplish this? I was hoping to find a plugin ...
Ed Staub's user avatar
  • 15.8k
5 votes
0 answers
721 views

My project folder structure is this: -frontend -src -components -__test__ -pages -dialogs - etc in __test__ folder there are all the test cases for components like ...
Muhammad Ahsan's user avatar

1
2 3 4 5
19