Vitest is a blazing-fast unit test framework powered by Vite.
Questions tagged [vitest]
501 questions
0
votes
1 answer
Pulumi aws lambda unit test fails with "Could not find property info for real property on object: sdk"
I am trying to use Pulumi to create an AWS Lambda that manipulates a DynamoDB table and is triggered by an API Gateway HTTP request.
My configuration works perfectly when I run pulumi up, but when I run Vitest, my test passes but exits with non-zero…

Dave
- 967
- 7
- 13
0
votes
0 answers
How to test a function that modifies the global scope?
I am earning unit testing. I know that best practice is that the functions should have local scope and they return something for example
export function test(arr) {
let arr2 = [];
for(let i = 0;i < arr.length;i++) {
if(arr[i] % 2 ===…

JohnJS
- 35
- 3
0
votes
1 answer
Syntax error when using vitest on my component test
I created a test to test the working of one of my buttons designed in solidjs using vitest and solid-testing-library. Here is my basic test:
import { screen, render, fireEvent } from 'solid-testing-library';
import { Messenger } from…

gks
- 191
- 1
- 4
- 18
0
votes
1 answer
vitest Svelte App with Typescript : ParseError ... Unexpected token ` : `
I am trying to setup some unit-tests with vitest on a Svelte Application (with Typescript support), and I get the following error:
ParseError: D:/(...)/src/Overlay.svelte:23:17 Unexpected token
In this file, that correspond to: