2024-03-06 16:03:12 +01:00
|
|
|
/* Configuration for Vitest testrunner.
|
|
|
|
* Copyright (C) 2024 André Jaenisch
|
|
|
|
* SPDX-FileCopyrightText: 2024 André Jaenisch
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2024-07-06 18:29:39 +02:00
|
|
|
import { resolve } from 'node:path';
|
|
|
|
|
2024-02-09 11:19:08 +01:00
|
|
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
2024-07-08 12:17:31 +02:00
|
|
|
import { svelteTesting } from '@testing-library/svelte/vite';
|
2024-02-09 11:19:08 +01:00
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
|
|
|
export default defineConfig({
|
2024-07-06 18:29:39 +02:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
// Help vitest find imported images
|
|
|
|
$lib: resolve('./src/lib')
|
|
|
|
}
|
|
|
|
},
|
2024-07-08 12:17:31 +02:00
|
|
|
plugins: [svelte({ hot: !process.env.VITEST }), svelteTesting()],
|
2024-02-09 11:19:08 +01:00
|
|
|
test: {
|
2024-02-09 11:29:03 +01:00
|
|
|
coverage: {
|
2024-07-30 12:55:35 +02:00
|
|
|
include: ['src'],
|
|
|
|
provider: 'istanbul'
|
2024-02-09 11:29:03 +01:00
|
|
|
},
|
2024-02-09 11:19:08 +01:00
|
|
|
include: ['tests/**/*.test.ts'],
|
|
|
|
environment: 'jsdom',
|
2024-07-08 12:17:31 +02:00
|
|
|
globals: true,
|
|
|
|
setupFiles: [resolve(__dirname, 'tests/components/setup.ts')]
|
2024-02-09 11:19:08 +01:00
|
|
|
}
|
|
|
|
});
|