chore(test): separate client & server tests

This commit is contained in:
Elian Doran 2025-02-26 18:39:00 +02:00
parent 909a74e8ac
commit ef736edf09
No known key found for this signature in database
4 changed files with 35 additions and 1 deletions

23
package-lock.json generated
View File

@ -49,6 +49,7 @@
"express-session": "1.18.1", "express-session": "1.18.1",
"force-graph": "1.49.0", "force-graph": "1.49.0",
"fs-extra": "11.3.0", "fs-extra": "11.3.0",
"happy-dom": "17.1.8",
"helmet": "8.0.0", "helmet": "8.0.0",
"html": "1.0.0", "html": "1.0.0",
"html2plaintext": "2.1.4", "html2plaintext": "2.1.4",
@ -10883,6 +10884,28 @@
"integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==", "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/happy-dom": {
"version": "17.1.8",
"resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-17.1.8.tgz",
"integrity": "sha512-Yxbq/FG79z1rhAf/iB6YM8wO2JB/JDQBy99RiLSs+2siEAi5J05x9eW1nnASHZJbpldjJE2KuFLsLZ+AzX/IxA==",
"license": "MIT",
"dependencies": {
"webidl-conversions": "^7.0.0",
"whatwg-mimetype": "^3.0.0"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/happy-dom/node_modules/whatwg-mimetype": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz",
"integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==",
"license": "MIT",
"engines": {
"node": ">=12"
}
},
"node_modules/has-flag": { "node_modules/has-flag": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",

View File

@ -44,7 +44,9 @@
"docs:build": "npm run docs:build-backend && npm run docs:build-frontend", "docs:build": "npm run docs:build-backend && npm run docs:build-frontend",
"build:webpack": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts", "build:webpack": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts",
"build:prepare-dist": "npm run build:webpack && rimraf ./dist && tsc && tsx ./bin/copy-dist.ts", "build:prepare-dist": "npm run build:webpack && rimraf ./dist && tsc && tsx ./bin/copy-dist.ts",
"test": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest", "test": "npm run test:server && npm run test:client",
"test:server": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest",
"test:client": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app",
"test:coverage": "cross-env TRILIUM_DATA_DIR=./integration-tests/db vitest --coverage", "test:coverage": "cross-env TRILIUM_DATA_DIR=./integration-tests/db vitest --coverage",
"test:playwright": "playwright test", "test:playwright": "playwright test",
"test:integration-edit-db": "cross-env TRILIUM_INTEGRATION_TEST=edit TRILIUM_PORT=8081 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts", "test:integration-edit-db": "cross-env TRILIUM_INTEGRATION_TEST=edit TRILIUM_PORT=8081 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
@ -99,6 +101,7 @@
"express-session": "1.18.1", "express-session": "1.18.1",
"force-graph": "1.49.0", "force-graph": "1.49.0",
"fs-extra": "11.3.0", "fs-extra": "11.3.0",
"happy-dom": "17.1.8",
"helmet": "8.0.0", "helmet": "8.0.0",
"html": "1.0.0", "html": "1.0.0",
"html2plaintext": "2.1.4", "html2plaintext": "2.1.4",

View File

@ -0,0 +1,7 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
environment: "happy-dom"
}
});

View File

@ -8,6 +8,7 @@ const customExcludes = [
"tests-examples/**", "tests-examples/**",
"node_modules/**", "node_modules/**",
"src/public/app-dist/**", "src/public/app-dist/**",
"src/public/app/**",
"libraries/**", "libraries/**",
"docs/**", "docs/**",
"out/**", "out/**",