Hey folks, I'm running into a problem and I'm not sure the best way to solve it.I'm using supertest + jest to run my integration test suite. On each test file, I require the app (const app = require('src/app')). The problem is that everytime I require the app module, a new database connection is created to my postgresql database, quickly reaching the MAX_CONNECTIONS_ALLOWED limit. As a side note, i'm not calling app.listen() to run these tests.Any ideas on what's the best way to avoid creating a new connection to the database every time I run a test file? Thanks!
Submitted June 06, 2019 at 02:12PM by ramadis
No comments:
Post a Comment