feat: include test directories in tsconfig files, disable no-explicit-any for test files, and document testing policy relaxations.
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"rootDir": "src",
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@sammo-ts/common": [
|
"@sammo-ts/common": [
|
||||||
@@ -27,7 +26,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"test"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"rootDir": "src"
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"test"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"rootDir": "src"
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"test"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ Goal: ensure scenario parsing and DB application are correct.
|
|||||||
- Unit tests: fast, wide coverage.
|
- Unit tests: fast, wide coverage.
|
||||||
- Integration tests: focus on real DB/Redis behavior.
|
- Integration tests: focus on real DB/Redis behavior.
|
||||||
- Smoke tests: minimal coverage of turn flow/build/scenario loading.
|
- 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
|
## MockDB Conclusion
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,12 @@ export default tseslint.config(
|
|||||||
'@typescript-eslint/no-empty-object-type': 'off',
|
'@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'],
|
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
|
||||||
rules: {
|
rules: {
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
"useUnknownInCatchVariables": true,
|
"useUnknownInCatchVariables": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"rootDir": "src"
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"test"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user