refactor(tools): simplify vitest config (#12108)

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
This commit is contained in:
axel7083 2025-04-09 12:13:27 +02:00 committed by GitHub
parent 9673091998
commit 56696165ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2024 Red Hat, Inc.
* Copyright (C) 2024-2025 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,11 +25,9 @@ import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';
import { fileURLToPath } from 'url';
import { coverageConfig } from '../vitest-shared-extensions.config';
let filename = fileURLToPath(import.meta.url);
const PACKAGE_ROOT = path.dirname(filename);
const PACKAGE_NAME = 'storybook';
// https://vitejs.dev/config/
export default defineConfig({
@ -49,7 +47,6 @@ export default defineConfig({
deps: {
inline: ['moment'],
},
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
},
base: '',
server: {

View file

@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-2025 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -53,6 +53,10 @@ const config = {
emptyOutDir: true,
reportCompressedSize: false,
},
test: {
environment: 'node',
include: ['src/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
},
};
export default config;

View file

@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-2025 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,8 +23,8 @@ const PACKAGE_NAME = 'website';
const config = {
test: {
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
environment: 'node',
include: ['*.{test,spec}.?(c|m)[jt]s?(x)'],
},
};