I am trying to set the test database for the testing purpose, but its not working.
I am trying to connect to mongodb using mongoose, but finding problem in connection er
To read from .env file you have to install dotenv ( npm i dotenv / yarn add dotenv) and then just add this on top of your file.
const dotenv = require("dotenv"); dotenv.config();