I'd like to have just a single instance of feathers "app" when a run jest tests. this is how I import app in every test:
const app = require('../../src/app');
describe(`service`, () => {
it('registered the service', () => {
const service = app.service('my-service');
expect(service).toBeTruthy();
});
The problem is that this is creating an instance app and I have over 100 tests, this quickly eats up all of postgres connections,
my app file exports like this :
const app = express(feathers());
app.configure(express.rest());
app.configure(objection);
// ... some more configs and bells & whistles
module.exports = app;
I thought about opening a socket as a client in the test suite, and instead of importing "app" I open a connection as a client, but thinking of alternatives to that in a test context.