From daefdc8b0a3040c0bc1d7cf22accb90759772e52 Mon Sep 17 00:00:00 2001 From: Akalanka Perera Date: Sun, 10 Mar 2024 18:00:06 +0000 Subject: [PATCH] Feat(mongoose-audit): setup mongo server before tests --- plugins/mongoose-audit/test/index.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/mongoose-audit/test/index.test.js b/plugins/mongoose-audit/test/index.test.js index ec0308f..c50169b 100644 --- a/plugins/mongoose-audit/test/index.test.js +++ b/plugins/mongoose-audit/test/index.test.js @@ -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") };