Skip to content

Commit

Permalink
Feat(mongoose-audit): setup mongo server before tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 authored Mar 10, 2024
1 parent d792d39 commit daefdc8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/mongoose-audit/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { default as mongoose } from "mongoose";
import { plugin, Audit } from "../src";
import { AuditType } from "../src/constants";

jest.setTimeout(120000)

const execute = promisify(exec)

const connectToDatabase = async () => {
await execute("docker run -d -p 27017:27017 mongo:5.0")
await new Promise((resolve) => setTimeout(resolve, 3000))
await mongoose.connect("mongodb://localhost:27017/test")
};

Expand Down

0 comments on commit daefdc8

Please sign in to comment.