From 9b8df32c5213684a84110de7b1ab7af82b6d55b8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 15 Nov 2021 15:57:02 +0000 Subject: [PATCH] Fixing issue where database wasn't accessible in authorized test. --- packages/server/src/middleware/tests/authorized.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/src/middleware/tests/authorized.spec.js b/packages/server/src/middleware/tests/authorized.spec.js index 3c3bf9bb36..d7052b323b 100644 --- a/packages/server/src/middleware/tests/authorized.spec.js +++ b/packages/server/src/middleware/tests/authorized.spec.js @@ -10,6 +10,7 @@ jest.mock("../../environment", () => ({ const authorizedMiddleware = require("../authorized") const env = require("../../environment") const { PermissionTypes, PermissionLevels } = require("@budibase/auth/permissions") +require("@budibase/auth").init(require("../../db")) class TestConfiguration { constructor(role) { @@ -21,6 +22,7 @@ class TestConfiguration { request: { url: "" }, + appId: "", auth: {}, next: this.next, throw: this.throw