@aligntrue/testkit
Version:
Conformance testkit for Align Spec v1 implementations
84 lines (83 loc) • 2.49 kB
JSON
[
{
"name": "passes-when-all-files-match",
"description": "Verifies that check passes when all files match the naming convention",
"check_type": "path_convention",
"rule": {
"id": "test-path-kebab-case",
"severity": "SHOULD",
"check": {
"type": "path_convention",
"inputs": {
"pattern": "^[a-z0-9-]+\\.tsx$",
"include": ["src/components/**"],
"message": "Component files must use kebab-case"
},
"evidence": "File name violates path convention"
}
},
"file_tree": {
"src/components/button.tsx": "content",
"src/components/input-field.tsx": "content"
},
"expected_findings": []
},
{
"name": "fails-when-files-violate-convention",
"description": "Verifies that check fails when files violate the naming convention",
"check_type": "path_convention",
"rule": {
"id": "test-path-kebab-case",
"severity": "SHOULD",
"check": {
"type": "path_convention",
"inputs": {
"pattern": "^[a-z0-9-]+$",
"include": ["src/components/**"],
"message": "Component files must use kebab-case"
},
"evidence": "File name violates path convention"
}
},
"file_tree": {
"src/components/Button.tsx": "PascalCase not allowed",
"src/components/input_field.tsx": "snake_case not allowed"
},
"expected_findings": [
{
"rule_id": "test-path-kebab-case",
"severity": "SHOULD",
"message": "Component files must use kebab-case",
"file": "src/components/Button.tsx"
},
{
"rule_id": "test-path-kebab-case",
"severity": "SHOULD",
"message": "Component files must use kebab-case",
"file": "src/components/input_field.tsx"
}
]
},
{
"name": "checks-filename-not-full-path",
"description": "Verifies that convention is checked against filename only, not full path",
"check_type": "path_convention",
"rule": {
"id": "test-path-kebab-filename",
"severity": "SHOULD",
"check": {
"type": "path_convention",
"inputs": {
"pattern": "^[a-z0-9-]+\\.(tsx|ts)$",
"include": ["src/**"],
"message": "Files must use kebab-case"
},
"evidence": "Convention violation"
}
},
"file_tree": {
"src/CamelCaseDir/kebab-file.tsx": "content"
},
"expected_findings": []
}
]