fix path and tests

This commit is contained in:
2025-09-24 06:10:52 +02:00
parent cdb1bda922
commit 0cd641a2bf
7 changed files with 845 additions and 6388 deletions
+3
View File
@@ -130,3 +130,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
tests//*.js/*.js.map
+816 -6352
View File
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -1,13 +1,14 @@
{
"name": "matrix-backend",
"version": "1.0.0",
"main": "index.js",
"type": "commonjs",
"main": "dist/index.js",
"scripts": {
"start": "tsc && cross-env NODE_ENV=development node dist/src/index.js",
"start": "cross-env NODE_ENV=development ts-node-dev --respawn --transpile-only src/index.ts",
"clean": "rimraf dist",
"build": "npm run clean & tsc",
"build": "tsc --project tsconfig.json",
"test": "vitest run",
"test:watch": "vitest run --watch",
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage"
},
"keywords": [],
@@ -43,6 +44,9 @@
"cross-env": "^7.0.3",
"prettier": "^3.2.5",
"supertest": "^7.1.4",
"ts-node-dev": "^2.0.0",
"vite": "^7.1.7",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.2.4"
}
}
-1
View File
@@ -15,7 +15,6 @@ async function bootstrap() {
throw new Error("CRITICAL ERROR: SPOTIFY_CLIENT_SECRET environment variable is not set.");
}
// Server-Instanz mit Konfiguration erstellen
const server = new Server({
port: baseConfig.port,
jwtSecret: SECRET_KEY,
+4 -6
View File
@@ -5,16 +5,14 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"lib": ["ES2022"],
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src",
"typeRoots": [
"./node_modules/@types",
"./types"
]
},
"include": [
"src/**/*.ts",
"tests/**/*.ts"
]
}
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "tests"]
}
+8
View File
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"rootDir": null
},
"include": ["src/**/*.ts", "tests/**/*.ts"]
}
+6 -25
View File
@@ -1,33 +1,14 @@
// vitest.config.ts
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
/**
* globals: true
* Das ist der wichtigste Punkt, um dein ursprüngliches Problem zu lösen.
* Diese Option weist Vitest an, die globalen APIs (describe, it, expect, vi)
* automatisch in allen Testdateien verfügbar zu machen.
*/
globals: true,
/**
* environment: 'node'
* Dies simuliert eine Node.js-Umgebung für deine Tests.
* Es ist essenziell für Backend-Tests, da es Node.js-APIs wie `process`
* zur Verfügung stellt.
*/
environment: 'node',
/**
* setupFiles: ['./tests/setup.ts']
* (Optional, aber sehr nützlich)
* Hier kannst du eine Datei angeben, die vor ALLEN Tests einmalig ausgeführt wird.
* Perfekt, um z.B. eine Verbindung zu einer Test-Datenbank aufzubauen oder
* globale Mocks zu definieren.
* Du kannst diese Zeile erstmal auskommentieren, wenn du sie nicht brauchst.
*/
// setupFiles: ['./tests/setup.ts'],
exclude: [
'node_modules',
'dist',
],
},
});