test(frontend): replace jest with vitest

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2025-04-26 14:27:29 +02:00
parent 5241a6e988
commit 49bbd32635
No known key found for this signature in database
GPG key ID: FE1CD209E3EA5E85
188 changed files with 1364 additions and 1212 deletions

31
frontend/vitest.config.ts Normal file
View file

@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
export default defineConfig({
test: {
environment: 'jsdom',
exclude: ['cypress/**/*'],
alias: [
{
find: /^.+\\.(svg)$/,
replacement: resolve(__dirname, './src/test-utils/svg-mock.tsx')
},
{
find: /^react-bootstrap-icons$/,
replacement: resolve(__dirname, './src/test-utils/bootstrap-icon-mocks.tsx')
},
{
find: RegExp('^react-bootstrap-icons/dist/icons/.*$'),
replacement: resolve(__dirname, './src/test-utils/svg-mock.tsx')
}
],
setupFiles: './vitest.setup.ts'
},
plugins: [react()]
})