diff --git a/server/src/routes/launches/launches.test.js b/server/src/routes/launches/launches.test.js index 7d368d4..2231001 100644 --- a/server/src/routes/launches/launches.test.js +++ b/server/src/routes/launches/launches.test.js @@ -73,9 +73,11 @@ describe("Launches API",()=>{ test("It should catch Invalid Dates",async ()=>{ const response=await request(app).post("/v1/launches") .send(lauchDataWithInvalidDate).expect("Content-Type",/json/) - .expect(400).expect(response.body).toStrictEqual({ - error:"Invalid launch date" - }) + .expect(400) + + expect(response.body).toStrictEqual({ + error: 'Invalid launch date', + }); }) // test("It should catch Invalid Dates", ()=>{}) diff --git a/server/src/services/mongo.js b/server/src/services/mongo.js index 13f048d..51389d2 100644 --- a/server/src/services/mongo.js +++ b/server/src/services/mongo.js @@ -1,3 +1,5 @@ +require("dotenv").config(); + const mongoose=require("mongoose");