Skip to content

Commit

Permalink
loads planets data in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
satyamkale27 committed Oct 27, 2024
1 parent 5f76c7d commit f471125
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/routes/launches/launches.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const request = require("supertest");
const app = require("../../app");
const { mongoConnect, mongoDisconnect } = require("../../services/mongo");
const { loadPlanetData } = require("../../models/planets.model");

describe("Launches API", () => {
beforeAll(async () => {
await mongoConnect(); // connect mongo before all //
await loadPlanetData(); // loads planets data befor testing // because loadplanetsData() is in server.js and in here in test server.js do not get called or starts so we call loadplanetsData manually //
});

afterAll(async () => {
Expand Down

0 comments on commit f471125

Please sign in to comment.