@paul Passing it as a parameter makes the modules much easier to test under different configurations, so I'd go for that.

I'd also type the config arguments as `Pick<ConfigType, 'whatever' | 'keys' | 'are' | 'needed'`>`, to limit the amount of boilerplate/mock needed in tests.

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Replies