This commit is contained in:
17
backend/__tests__/__testData__/controller-test.ts
Normal file
17
backend/__tests__/__testData__/controller-test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import request from "supertest";
|
||||
import app from "../../src/app";
|
||||
import { ObjectId } from "mongodb";
|
||||
import { mockBearerAuthentication } from "./auth";
|
||||
import { beforeEach } from "vitest";
|
||||
|
||||
export function setup() {
|
||||
const mockApp = request(app);
|
||||
const uid = new ObjectId().toHexString();
|
||||
const mockAuth = mockBearerAuthentication(uid);
|
||||
|
||||
beforeEach(() => {
|
||||
mockAuth.beforeEach();
|
||||
});
|
||||
|
||||
return { mockApp, uid, mockAuth };
|
||||
}
|
||||
Reference in New Issue
Block a user