Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content
Stack Overflow
  1. About
  2. For Teams
Loading…
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives
919 questions
Filter by
Sorted by
Tagged with
-1votes
0answers
17views

Type error not caught in `vitest.config.ts`

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
-1votes
0answers
38views

How to pass a class to vi.fn?

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 ...
1vote
0answers
35views

How do I specify to WebStorm the canonical definition of the Vuex store?

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

How to remove setTimeout in Vitest?

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

How to avoid target.hasPointerCapture is not a function when testing Radix UI (shadcn) components with Vitest + userEvent?

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

Mocking Vitest functions for testing Pinia storage

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

Accessing calls/args in a global mock with spied functions

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 ...
danwellman's user avatar
0votes
0answers
17views

Use MSW with a self-signed certificate for a specific domain

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

Vitest/JSDOM: Native <dialog> Not Opening in Tests Despite All Fixes (Lightbox Modal Component)

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....
herrjosua's user avatar
0votes
1answer
81views

Error running vitest with npm run test:ui: Error: listen EACCES: permission denied ::1:51204

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: ...
Cary Bondoc's user avatar
1vote
2answers
115views

In `test.projects`, each subfolder is a project, but the parent folder is also treated as one, so tests run twice

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 ...
rozsazoltan's user avatar
0votes
2answers
95views

How to programmatically get vitest test name?

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
-4votes
1answer
65views

Use property from object as test name in test.for

When I use:describe("ExtractDateFromText", () => { test.for(scannedReceiptText)('Filename %s', async (expected) => { const dateResult = dateFromRawData(...
Mark Levison's user avatar
0votes
2answers
70views

$effect “forgets” state change, test crashes with “Cannot read properties of undefined”

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

Cannot use GraphQLSchema [...] from another module or realm

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 ...

153050per page
1
2345
62

Hot Network Questions

more hot questions
Newest vitest questions feed

[8]ページ先頭

©2009-2025 Movatter.jp