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

I have this bun expressjs typescript application and this is my folder structure. I wrote some tests using vitest which are placed in the tests/ directory and the tests are executing perfectly with ...
Tharisha Perera's user avatar
-1 votes
1 answer
239 views

I don't seem to find a solution for the below code / test to work (I went through a lot of articles and stackOverflow...). Various solutions provided by chatGPT are useless as well. I also see people ...
GiedreA's user avatar
0 votes
0 answers
22 views

I wrote a test which creates a Venue with attachments property which is of Graphql Upload type. But when I try to run the test, it fails with error "message": "Variable \"$...
Amaan_aly's user avatar
0 votes
0 answers
136 views

For some reason in ViTest mocks are not replacing my real function. I have a main function here const { handler1 } = require(./path/handler1) exports.mainFunction = async (event) => { try { ...
user2569803's user avatar
1 vote
1 answer
498 views

I’m working on a Vue component that contains a custom element with a shadow DOM. I want to test the content inside the shadow root of this custom element using Vue Test Utils. However, when I use ...
SandyKrish's user avatar
0 votes
0 answers
94 views

I'm setting up my Storybook stories I'm trying too mock a call to an API. Here's the code: import type { StoryObj, Meta } from '@storybook/react'; import { createMock, getMock } from 'storybook-addon-...
pandabrand's user avatar
0 votes
1 answer
121 views

I was having a problem testing my application because vuetify3 uses teleports in their v-menus, v-dialogs, v-tooltips, etc. We can disable the teleports by using attach, but that breaks some of our ...
jesse ekstrom's user avatar
-4 votes
1 answer
235 views

Using createMemoryRouter to create router to render doesn't work. It renders and error page. import { vi, describe, it, expect } from 'vitest' import { render } from '@testing-library/react' import { ...
vatsal chauhan's user avatar
0 votes
0 answers
35 views

First of all I have to say that the nuxt documentation for unit testing a nuxt module is sooo bad, me and all my colleagues are not able to create even a tiny unit test. So what I am trying to do is ...
CommanderData's user avatar
0 votes
0 answers
179 views

Is there a special configuration I need for vi.mock('../src/some/file', ...) to work in browser mode? Is it supported for a specific provider or browser? I think it's implemented, but I can't get it ...
Miguel Leon's user avatar
0 votes
1 answer
49 views

I ran into this problem when trying to generate tests using AI. It generated the tests with mount() and it works, but when you ask it to use shallowMount(), the attributes on tags are removed, and a ...
imqqmi's user avatar
  • 503
0 votes
1 answer
396 views

In my <App /> component I want to show a loading screen until I've fetched my data and after fetching my data all the images(whose source's I got from my data) are loaded. I am having difficulty ...
vatsal chauhan's user avatar
1 vote
0 answers
291 views

The page that I'm trying to write unit tests about is as follows: <script setup lang="ts"> import { Content, fetchOneEntry, isPreviewing } from '@builder.io/sdk-vue' import { useRoute }...
Nessario's user avatar
0 votes
1 answer
216 views

I have simple test automation project with TypeScript + Vitest + allure-vitest reporter. I have tried to upgrade/downgrade main dependencies without any luck. It works perfectly on one type of machine ...
user1411968's user avatar
0 votes
0 answers
541 views

I can run my Vitest usually, but when I try to import a react native link, it breaks with the error below: RollupError: Parse failure: Expected 'from', got 'typeof' At file: /mobile-app/node_modules/...
Zorayr's user avatar
  • 25.1k
0 votes
0 answers
171 views

I'm building a browser library for consumption by our clients where they can include it in their site and utilize it to access our services, etc. I am trying to set up unit testing for the library. ...
Mike G's user avatar
  • 1,994
0 votes
3 answers
576 views

I have an npm script in the package.json: "test:coverage": "vitest run --coverage", Also, there is a hello.test.ts test file. I want: Vitest to run a single hello.test.ts file ...
sonata22's user avatar
1 vote
1 answer
1k views

In vitest you can expect a Promise to be resolved using this code: await expect(expected, "custom message").resolves.toBeUndefined() However, when failing to resolve, the custom message is ...
Blee's user avatar
  • 685
0 votes
0 answers
178 views

I am trying to assert that a component has a certain style in one of my tests. In the browser this component has the correct style but when I run my vitest test I get an incorrect style. It looks like ...
Peter's user avatar
  • 330
1 vote
1 answer
220 views

I'm trying to add additional information to failing tests in a bigger typescript project. I found the onTestFailed hook that registers a callback function to a test. So for a quick test, I followed ...
AbcAeffchen's user avatar
  • 15.1k
0 votes
0 answers
113 views

I'm trying to write a test using Vitest for a function localComplement that modifies a graph represented using Cytoscape.js. Here's the function: export function localComplement(cy: any, elements: ...
P.Chian's user avatar
  • 65
3 votes
1 answer
862 views

I tried following another related post on this topic with the creator's same outcome. Since its post is dead I'd like to try again if someone has an idea on how to mock the node:crypto function or ...
Alberto's user avatar
  • 41
1 vote
1 answer
361 views

I am migrating a React application from craco/Jest to Vite/Vitest The application also used AntDesign and before the test was running flawlessy. React version is 18.20 . NB we are trying to also mock ...
Enrico Scantamburlo's user avatar
0 votes
1 answer
38 views

I'm trying to understand kdbxweb, the database powering keeweb, compatible to Keepass. I did setup a simple project using vite and vitest that creates, saves and loads a database. Works like a charm ...
stwissel's user avatar
  • 20.5k
0 votes
0 answers
103 views

Im currently writing Unit test for a Vue component. The component renders the floorplan of a office. For that it generates an svg with the tables of the office. These are saved in a json. The Vue ...
Leander's user avatar
  • 21

1
2
3 4 5
19