mirror of
https://github.com/unraid/api.git
synced 2026-01-01 22:20:05 -06:00
This gets the original 3 component tests refactored to better follow the Vue Testing Library philosophy and test behavior. This also adds a new test file for the server store. Additional batches of tests will be added in proceeding PR's. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Streamlined internal code organization and improved maintenance through refined import structures and cleanup of redundant files. - **Tests** - Expanded and restructured automated tests across core components, including new test files for `Auth`, `DownloadApiLogs`, and `KeyActions` to ensure robust behavior. - Enhanced test configuration and mock implementations for a more reliable, consistent testing environment. - Introduced best practices for testing Vue components and Pinia stores. These updates optimize performance and stability behind the scenes without altering the end-user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mdatelle <mike@datelle.net>
33 lines
754 B
JavaScript
33 lines
754 B
JavaScript
import { fileURLToPath } from 'node:url';
|
|
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
server: {
|
|
deps: {
|
|
inline: [/.*\.mjs$/],
|
|
interopDefault: true,
|
|
registerNodeLoader: true,
|
|
},
|
|
},
|
|
setupFiles: ['./__test__/setup.ts'],
|
|
globals: true,
|
|
mockReset: true,
|
|
clearMocks: true,
|
|
restoreMocks: true,
|
|
include: ['__test__/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts}'],
|
|
testTimeout: 5000,
|
|
hookTimeout: 5000,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'~': fileURLToPath(new URL('.', import.meta.url)),
|
|
'@': fileURLToPath(new URL('.', import.meta.url)),
|
|
},
|
|
},
|
|
});
|