the-draupnir-project / planning

0 stars 0 forks source link

[Story] As a Draupnir developer, I can define Draupnir commands with breakable dependencies that can be unit tested #22

Closed Gnuxie closed 1 month ago

Gnuxie commented 4 months ago

Description

Currently, the API for defining commands provides a context object containing the whole Draupnir instance, a matrix client, and a few other utilities that cover a large API. All commands currently depend on different parts of this context object which complicates testing.

If we can break the dependencies down, like how we have done so for protections, then commands (and some Draupnir protections even) will become easier to unit test. This can be done by using a wrapper similar to the "capability context glue" trick that is used in MPS.

Acceptance Criteria

Pull requests