I’m new to testing so maybe it’s obvious, but I have no clue why is this happening.
I have a file which looks like this:
class ExampleService {}
const exampleService = new ExampleService()
export {exampleService, ExampleService}
In another file, this works in the app but not in test/full-app test:
const { exampleService } = require('/example')
exampleService
will be undefined
during the test (but when I run the app normally, it works).
The funny thing is that this works in tests:
const { ExampleService } = require('/example')
const exampleService = new ExampleService()
What am I missing?