I want to test a controller which adds a record in the database, but I notice that even a select query throws an error, however when I add the record through my program, it is saved in the database. For example only this query does not return anything but an error.
const facility = await db.facility.findOne({
where: { id: req.body.facility_id },
raw: true,
});
why does this query does not work in jest test file?
how can I solve this?
what is the best way to it?