Open joelgallant opened 3 years ago
the documentation currently says that
In Node.js, App Config might work without any configuration.
however this doesn't seem to be the case. as far as i can tell, it's impossible to load app-config in jest. calling loadConfig
in setupFiles
or globalSetup
don't seem to work
I think something like this is required - https://github.com/facebook/jest/issues/949
Or, following https://github.com/facebook/jest/issues/11038#issuecomment-770182413
In my experience, I've tended to either loadConfig
explicitly in beforeEach
, or jest.mock
'ed.
I'm still quite interested in providing a jest plugin to make this plug-and-play.
I would rather not point to "just mock the module" when asked how to test app-config.