Closed vlourme closed 3 years ago
Hi @vlourme
What is your test code? Do you call await createConnection()
somewhere in your test ? For example with a before(async () => { await createConnection() });
?
Thank you for your fast answer! It effectively works.
I was able to make it common by adding this into the global test.ts
file:
let connection: Connection;
before(async () => {
console.log('Creating database connection');
connection = await createConnection();
});
after(async () => {
console.log('Closing database connection');
await connection.close();
});
Hello! I'm facing a problem with TypeORM
ConnectionManager
and FoalTS Unit Testing.When running the project with
npm run develop
, everything works fine. But when trying unit testing, the connection to the DB is not made (using MongoDB).Here are some files and logs from the project:
ormconfig.js
Logs after running
npm run test
:I'd be happy to create a pull request to fix the problem, I'm just lost actually to find where the issue comes from. Thank you!