919 questions
0
votes
0
answers
19
views
ApolloError: No more mocked responses for the query: mutation
I am getting an error "ApolloError: No more mocked responses for the query: mutation CreatePost($text: String!, $title: String!, $imageUrl: URL, $videoUrl: URL, $organizationId: ID!, $file: ...
4
votes
1
answer
826
views
vitest with AnalogJS angular-vite-plugin | Error: No test suite found in file
I have a monorepo with an Angular project and a few Node.js projects.
Running vitest locally, all tests are passing. However, in GitHub Actions, the Angular tests are failing.
GitHub Actions test ...
-1
votes
1
answer
94
views
Can Jest/Vitest output console log not interleaved when running test in parallel mode?
Jest and Vitest by default run test files in parallel.
An issue with this is that the console.log from different test files are interleaved.
Is there a way to run the tests in parallel, but save the ...
3
votes
1
answer
1k
views
Drizzle ORM: How to generate "CREATE TABLE" SQL from pgTable definition?
Is there a built-in way in Drizzle ORM to generate the CREATE TABLE IF NOT EXISTS SQL directly from the pgTable schema definition?
Here’s an example of how I’m currently setting up an in-memory pglite ...
1
vote
1
answer
700
views
SvelteKit: "No overload matches this call" error invite.config.js when working with vitest
I just created an app with pnpx sv create sveltekit-test2
and checked vitest
and now when I run pnpm check I get this error:
Loading svelte-check in workspace: /home/sas/devel/apps/dgiit/proyectos/tmp/...
0
votes
1
answer
76
views
React custom hook testing with vitest returns empty result
I have created a custom hook as follows:
import { getUserInfo } from '@/scripts/services/userService';
import { useState, useEffect } from 'react';
const useFileFilter = (repositoryFiles: any[]) =>...
0
votes
0
answers
247
views
An error occurs when writing tests for node:crypto with Vitest
I want to write tests for the following function using Vitest.
import { randomUUID } from "node:crypto";
export const getRandomUUID = (): string => {
return randomUUID();
}
I wrote ...
0
votes
3
answers
1k
views
Svelte 5, Problem with tests, why am I getting this overload error in my vite.config file and how do I fix it?
Github Repo: https://github.com/Gaban-Ventures/crypto-basis-frontend
With the latest commit you have to run npm install --legacy-peer-deps
To run normal before the breaking tests, do:
git co ...
0
votes
1
answer
3k
views
toBeInTheDocument Matcher Not Working in Vitest with @testing-library/jest-dom
I’m having trouble using the toBeInTheDocument matcher with Vitest and @testing-library/jest-dom in my TypeScript project. Even though I have installed and configured everything correctly, I’m still ...
0
votes
0
answers
69
views
Issue: slots Field in Typings for Svelte Component Testing
I am building a Svelte component library for my project and have run into several issues, particularly when trying to test components with slots. Here's the error I'm facing:
Object literal may only ...
-2
votes
1
answer
139
views
Code behaves differently in Vitest vs React
I have a simple test case:
import {describe, it, test} from "vitest";
import {decodeBase64, hexlify} from "ethers";
describe('zapModule', () => {
it('smoke test vitest', ...
0
votes
0
answers
138
views
How to mock multiple refs (and refs in general) in Nuxt?
I'm looking for a way to mock multiple refs (and refs in general) in Nuxt? I'm using Vitest and Nuxt test utils.
About my Case:
I want to test a SideBar.vue component. The component has multiple refs:
...
0
votes
1
answer
647
views
Vitest Async Mock Failing and Returning Undefined
I'm trying to write a unit test for an onMounted lifecycle hook for my Vue 3 component. I'm mocking the resolved value for an async call but it keeps returning undefined. As a result my last expect ...
0
votes
1
answer
526
views
Vuetify cannot find useGroup injection when mounting a custom component in a test
Background:
Vue3 app, using Vuetify, vitest, and vue-testing-library.
Problem:
I have a custom component whose template looks something like this:
<template>
<v-expansion-panel>
... ...
2
votes
0
answers
35
views
Read props of a Child component vue
Im currently writing tests for a Vue component (Calendar.vue) for that I need to get the array generated by the fillArray() function. My aproach is to read out the props of the Day.vue component but ...
1
vote
1
answer
60
views
importing enums from prisma returns undefined in testing environments
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", (...
0
votes
0
answers
61
views
After the third line, the Vue file inside the pages folder code is not covered
After the third line, the code in the pages folder was not covered when selecting the v8 for coverage. How can I achieve this? I have provided the configuration and code changes in below.
Vitest....
1
vote
1
answer
2k
views
Vitest Error: No test found in suite <anonymous> [closed]
I using vitest for my testing environment, and after creating a new test, I'm getting the following error in my console:
Error: No test found in suite
I'm not sure what I'm doing wrong. Here's my ...
-1
votes
2
answers
103
views
Why is function never called in test
I need help regarding a specific test. I have a Component, that is toggling the sound on and off in my project. The last test, with which I try to test if the e.prevenDefault gets called does not work,...
0
votes
1
answer
33
views
import not understood by test, resolve error thrown
When I run the test getting the error as:
Error: Failed to resolve import "@/components/card/LoadingCards" from "app/page.tsx". Does the file exist?
Plugin: vite:import-analysis
...
0
votes
1
answer
116
views
Mock Multer for multiple tests (vitest and Typescript)
I wanna test my route. The problem is that I can't mock "multer" multiple times with different content. My Test:
import request from "supertest";
import express from "express&...
2
votes
1
answer
394
views
Classname does not match in Vitest snapshot
We have a Vitest setup for Vite-based React project using MUI.
When we create a snapshot of a component, the class part will have hashed classnames like the following:
<div class="...
1
vote
0
answers
34
views
Unable to trigger handler's REST API call
I am writing mocks responses (using MSW) for a test case for an API call when a page is rendered in vitest and I am unable to trigger the REST API call defined in a handler.
Technically, if the API is ...
4
votes
0
answers
1k
views
Vitest: Getting vi.mocked(...).mockImplementation is not a function after hot reloading
I using Vitest with React to make tests. I want to make a "simple" test, to simulate a basic user for my app. The test, when I run npm run test works, the problem is that if I make a change ...
0
votes
1
answer
250
views
Vitetest / Vite / Vue create test objects for controls that don't generate error: Cannot read properties of null (reading 'createComment')
I would like to add some tests that actually try to load Popup.vue and ToolTip.vue in my project. The source code is in git at: https://github.com/geewhizbang/gw-popup
It's not that the popup doesn't ...