Skip to content

Commit

Permalink
TEST5
Browse files Browse the repository at this point in the history
  • Loading branch information
brok3turtl3 committed Nov 29, 2023
1 parent 9c2db63 commit 4f14610
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions __tests__/db.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ describe("connectDB", () => {
jest.clearAllMocks();
});

it("should call mongoose.connect with MONGO_URI", async () => {
xit("should call mongoose.connect with MONGO_URI", async () => {
process.env.MONGO_URI = "test-mongo-uri";
await connectDB();
expect(mongoose.connect).toHaveBeenCalledWith("test-mongo-uri");
});

it("should log an error and exit the process if mongoose.connect fails", async () => {
xit("should log an error and exit the process if mongoose.connect fails", async () => {
process.env.MONGO_URI = "test-mongo-uri";
(mongoose.connect as jest.Mock).mockImplementationOnce(() => {
throw new Error("test error");
Expand All @@ -44,7 +44,7 @@ describe("connectDB", () => {
expect(mockExit).toHaveBeenCalledWith(1);
});

it("should throw an error if MONGO_URI is not defined", async () => {
xit("should throw an error if MONGO_URI is not defined", async () => {
delete process.env.MONGO_URI;

await connectDB();
Expand Down

0 comments on commit 4f14610

Please sign in to comment.