What problem does it solve?
This Skill streamlines the process of writing comprehensive tests for the Telegram Bot API, ensuring the library's robustness and correctness.
Core Features & Use Cases
- Test Class Setup: Provides a clear structure for creating test classes using
BotTestContext and Kotest AnnotationSpec.
- API Call Helpers: Offers convenient methods (
action.sendReq, SimpleAction.sendReq) for making API calls within tests.
- Assertion Methods: Includes built-in assertions for success (
.shouldSuccess()) and failure (.shouldFailure()), with options for checking error messages.
- Rate Limit Handling: Demonstrates how to gracefully handle potential 429 (Too Many Requests) errors.
- Use Case: When a new Telegram API method like
setStickerPositionInSet is added to the library, this Skill guides you through creating the necessary unit tests to verify its functionality.
Quick Start
Create a new test file in the telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/ directory, extending BotTestContext and defining a test function with backticks.