mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
enforce test file-naming rule (#5820)
## Summary Enforced test file naming conventions with ESLint rules and renamed 26 test files from `.spec.ts` to `.test.ts`. ## Changes - **What**: Added ESLint rules to enforce `.spec.ts` files only in `browser_tests/tests/` and `.test.ts` files only in `src/` - **What**: Renamed 26 component/unit test files from `.spec.ts` to `.test.ts` to comply with new convention ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5820-enforce-test-file-naming-rule-27b6d73d365081269b32ddcc9d3a5048) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -181,5 +181,31 @@ export default defineConfig([
|
||||
{ disallowTypeAnnotations: false }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.spec.ts'],
|
||||
ignores: ['browser_tests/tests/**/*.spec.ts'],
|
||||
rules: {
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: 'Program',
|
||||
message: '.spec.ts files are only allowed under browser_tests/tests/'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['browser_tests/tests/**/*.test.ts'],
|
||||
rules: {
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: 'Program',
|
||||
message:
|
||||
'.test.ts files are not allowed in browser_tests/tests/; use .spec.ts instead'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user