You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pattern will allow us to define a function that returns the application given a configuration. Then we can carry the configuration around as part of the application state, rather than relying on environment variables / global variables.
The text was updated successfully, but these errors were encountered:
More importantly -- this issue caused me to lose a lot of time debugging when a test accidentally imported an HTTP method (from a module that imported the settings) rather than the method of the same name from the client. This caused the settings to be loaded from the environment too early. The app factory would make it more explicit.
This allows the tests to inject a specific configuration directly,
rather than relying on having the environment set before the config
is loaded. It avoids errors like what took me a few hours to debug
when I imported the wrong thing in tests, causing the environment to
be read too early.
This closes#77.
* refactor: Switch to a factory method for the app
This allows the tests to inject a specific configuration directly,
rather than relying on having the environment set before the config
is loaded. It avoids errors like what took me a few hours to debug
when I imported the wrong thing in tests, causing the environment to
be read too early.
This closes#77.
* format and lint
This pattern will allow us to define a function that returns the application given a configuration. Then we can carry the configuration around as part of the application state, rather than relying on environment variables / global variables.
The text was updated successfully, but these errors were encountered: