6 questions
0
votes
1
answer
481
views
Using Vue JS 3, vitest and happy-dom, how do I mount a component that requires an HTMLElement's clientWidth?
We have a component that does the following:
Inside the template, has a div referred to as workspace
when the component is mounted, inside the onMounted() it calls a method to calculate size
the ...
0
votes
1
answer
296
views
Dealing with the deprecated `document.queryCommandSupported`
I have trouble running vitest (in the "happy-dom" environment) for UI code that uses the deprecated document.queryCommandSupported function. This deprecated function is being used by the ...
0
votes
1
answer
1k
views
How can I fix my configuration so Vitest + Happy-Dom + RTL renders class names
I'm in the process of migrating our test runner from jest to vitest, and am having a bit of an issue related to the output of class names during tests. Currently, the class names are not being ...
1
vote
2
answers
4k
views
How to use a global variable in Vitest
I am writing a unit test in Vue, Vitest. Now I have a config object in a file in my public folder. This is being used as env variables. Not ideal, but it's a legacy project we're migrating. One step ...
0
votes
1
answer
445
views
`useResizeContainer` throwing errors when using `happy-dom` as test environment
When mounting a DataGrid in a test suite using happy-dom, it throws the error:
MUI: useResizeContainer - The parent DOM element of the data grid has an empty height.Please make sure that this element ...
2
votes
1
answer
4k
views
Vitest - FormData is not a constructor problem with test unit
I'm using Vistest for the test unit in a proyect with Vue + Vite. I have a helper for upload images to Cloudinary, the problem is when run the test, Vitest return this error in console
Ocurrio un ...