diff --git a/app/game-api/tsconfig.json b/app/game-api/tsconfig.json index cdab0d8..f931842 100644 --- a/app/game-api/tsconfig.json +++ b/app/game-api/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": "dist", "composite": true, - "rootDir": "src", "baseUrl": ".", "paths": { "@sammo-ts/common": [ @@ -27,7 +26,8 @@ } }, "include": [ - "src" + "src", + "test" ], "references": [ { diff --git a/app/game-engine/tsconfig.json b/app/game-engine/tsconfig.json index 9e979cd..c475888 100644 --- a/app/game-engine/tsconfig.json +++ b/app/game-engine/tsconfig.json @@ -3,10 +3,10 @@ "compilerOptions": { "outDir": "dist", "composite": true, - "rootDir": "src" }, "include": [ - "src" + "src", + "test" ], "references": [ { diff --git a/app/gateway-api/tsconfig.json b/app/gateway-api/tsconfig.json index 46edbbd..d890170 100644 --- a/app/gateway-api/tsconfig.json +++ b/app/gateway-api/tsconfig.json @@ -3,10 +3,10 @@ "compilerOptions": { "outDir": "dist", "composite": true, - "rootDir": "src" }, "include": [ - "src" + "src", + "test" ], "references": [ { diff --git a/docs/testing-policy.md b/docs/testing-policy.md index acd8398..62d3b5e 100644 --- a/docs/testing-policy.md +++ b/docs/testing-policy.md @@ -55,6 +55,10 @@ Goal: ensure scenario parsing and DB application are correct. - Unit tests: fast, wide coverage. - Integration tests: focus on real DB/Redis behavior. - Smoke tests: minimal coverage of turn flow/build/scenario loading. +- Test-specific Rule Relaxations: + - To simplify mocking and complex state preparation, the use of `any` type is allowed in test files. + - Type casting tricks like `as unknown as YourType` are also permitted in test code for convenience. + - However, test code must still be covered by TypeScript type checking to ensure API consistency and prevent regressions. ## MockDB Conclusion diff --git a/eslint.config.js b/eslint.config.js index bac1491..60c1c95 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -76,6 +76,12 @@ export default tseslint.config( '@typescript-eslint/no-empty-object-type': 'off', }, }, + { + files: ['**/test/**/*.ts', '**/*.test.ts', '**/*.spec.ts'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + }, + }, { files: ['**/*.js', '**/*.mjs', '**/*.cjs'], rules: { diff --git a/packages/logic/tsconfig.json b/packages/logic/tsconfig.json index 7aceea6..cb2ecb9 100644 --- a/packages/logic/tsconfig.json +++ b/packages/logic/tsconfig.json @@ -19,10 +19,10 @@ "useUnknownInCatchVariables": true, "noUnusedLocals": true, "noUnusedParameters": true, - "rootDir": "src" }, "include": [ - "src" + "src", + "test" ], "references": [ {