Description
One of the key values of creating OpenAPI specs is the ability to implement automated testing against them. This form of testing ensures the accuracy of the spec, while acting as a gating mechanism to catch any unexpected breaking changes. While we are not yet fully enforcing this form of testing for all APIs, we should have a user guide that outlines how to set up such testing, so that API maintainers can reference it in the future.
Conditions of acceptance
- Create a user guide for how to implement mocha tests that verify spec accuracy.
- Tests should focus on verifying that defined JSON responses match actual responses returned by the API itself.
- Tests are assumed to run as part of CI, so that unexpected breaking changes are caught before release.
- Include references to existing tests, implemented for MediaWiki REST APIs, as examples.
- Document any known gaps or challenges with specific types of endpoints (for example, verifying media responses)
- Review the guide with the team.
- Publish to mediawiki.org