**Add Vitest support and migrate frontend tests**

- Added Vitest configuration (`vitest.config.mjs`) for frontend unit testing with a `jsdom` environment.
- Migrated and rewrote key frontend tests (`api.test.js`, `comiclist.test.js`, `comicreader.test.js`, `historytable.test.js`, `router.test.js`, `store.test.js`) to Vitest, improving maintainability.
- Removed `tsconfig.json` and related TypeScript loaders from `webpack` configurations (`webpack.dev.js`, `webpack.prod.js`).
- Adjusted `eslint.config.mjs` to support Vitest tests.
- Updated `package-lock.json` to include Vitest, test utilities (`jsdom`, `@vue/test-utils`), and other associated packages.
- Updated Nginx configuration for better compression on assets (`gzip` adjustments).
- Enhanced `entrypoint.sh` to include first-run library indexing (`--if-empty` argument).
- Simplified the `scan_comics` command with a dedicated test for empty database scans.

This transition improves testing workflows and backend/frontend synergy while removing unused TypeScript dependencies.
This commit is contained in:
ajurna committed 2026-10-14 10:07:14 +01:00
1 parent ce809ed1a9
commit cc557543c5
19 files changed
+2388 -586

No files matched your search

+8 -3
View File
@@ -5,7 +5,8 @@
"scripts": {
"serve": "webpack-dev-server --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"lint": "eslint ."
"lint": "eslint .",
"test": "vitest run"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^7.3.1",
@@ -24,18 +25,22 @@
"vuex": "^4.1.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@vitejs/plugin-vue": "^6.0.10",
"@vue/test-utils": "^2.5.1",
"css-loader": "^7.1.5",
"eslint": "^10.12.0",
"eslint-plugin-vue": "^10.11.1",
"jsdom": "^30.1.2",
"mini-css-extract-plugin": "^2.10.2",
"style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.6.1",
"vitest": "^5.0.4",
"vue-loader": "^17.4.2",
"webpack": "^5.111.1",
"webpack-bundle-tracker": "^3.2.4",
"webpack-cli": "^7.2.3",
"webpack-dev-server": "^6.0.0",
"@eslint/js": "^10.0.1"
"webpack-dev-server": "^6.0.0"
},
"browserslist": [
"defaults"