Write Scout API tests
Scout API tests validate HTTP endpoints with realistic scoped credentials.
Important
- Prepare with higher-privilege helpers (
apiServices,kbnClient,esArchiver, …) - Authenticate with
requestAuth(orsamlAuthforinternal/*) - Call the endpoint under test with
apiClient+ the scoped headers - Assert status + response body, and verify side effects when needed
See best practices for API tests.
Example test (Console).
API tests live under <plugin-root>/test/scout/api/tests and must end with .spec.ts.