Fixing issue where database wasn't accessible in authorized test.

This commit is contained in:
mike12345567 2021-11-15 15:57:02 +00:00
parent bf4a8737f0
commit 9b8df32c52
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,7 @@ jest.mock("../../environment", () => ({
const authorizedMiddleware = require("../authorized") const authorizedMiddleware = require("../authorized")
const env = require("../../environment") const env = require("../../environment")
const { PermissionTypes, PermissionLevels } = require("@budibase/auth/permissions") const { PermissionTypes, PermissionLevels } = require("@budibase/auth/permissions")
require("@budibase/auth").init(require("../../db"))
class TestConfiguration { class TestConfiguration {
constructor(role) { constructor(role) {
@ -21,6 +22,7 @@ class TestConfiguration {
request: { request: {
url: "" url: ""
}, },
appId: "",
auth: {}, auth: {},
next: this.next, next: this.next,
throw: this.throw throw: this.throw