matrix-org / conference-bot

The conductor for your orchestra^Wconference
Apache License 2.0
44 stars 7 forks source link

Decouple service from global state #186

Closed Half-Shot closed 11 months ago

Half-Shot commented 1 year ago

This PR effectively refactor the service to stop depending on global state, which allows us to start testing the service in it's component pieces. Quite a lot of the codebase depended on the global config, which means we'd have to mock it every time in order to run tests. This PR fully separates out the code from the config which will allow us to start testing,

Review Guide

I'm afraid this is fairly wide ranging, so I'll try to explain my changes:

Half-Shot commented 12 months ago

I think this is probably ready for a first pass review.

reivilibre commented 11 months ago

The config is no longer global, but passed between the major classes.

thank you so much, the global config bothered me a lot but I didn't know if it was just conventional in node apps or so, or what the right fix was (I'm not a JS/TS developer by trade)