hitspec validate
Validate.http and .hitspec files for syntax errors without executing them.
Arguments
| Argument | Description |
|---|---|
<file> | Single .http or .hitspec file to validate |
<directory> | Directory to search recursively for test files |
Behavior
Thevalidate command parses each file and reports:
- Syntax errors (malformed requests, invalid headers)
- Invalid assertion syntax
- Undefined variables
- Circular dependencies
Valid: prefix. If any file has errors, the command prints the error and exits with a non-zero status.
Examples
Sample Output
Use in CI/CD
hitspec list
List all requests defined in.http and .hitspec files.
Arguments
| Argument | Description |
|---|---|
<file> | Single .http or .hitspec file |
<directory> | Directory to search recursively for test files |
Behavior
Thelist command parses each file and prints each request with its name and tags. If a request has no @name annotation, the method and URL are used as the display name.
Examples
Sample Output
Use Cases
- Discover available tests in a project
- Verify request names before filtering with
--name - Audit tag coverage across test files
- Quick inventory of API endpoints under test