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 e72db84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/mongoose-audit/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { default as mongoose } from "mongoose";
import { exec } from "child_process";
import { promisify } from "util";
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 e72db84

Please sign in to comment.