fix: maybe fix flakey test with kshook

This commit is contained in:
zkldi
2023-10-16 12:57:26 +01:00
parent 37516ffc56
commit cd58e2e150
2 changed files with 22 additions and 8 deletions
+3 -6
View File
@@ -34,16 +34,13 @@ export async function CreateFakeAuthCookie(mockApi: supertest.SuperTest<supertes
return setCookieHeader;
}
// my local dev env hates this part because of pnpm
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function InsertFakeTokenWithAllPerms(token: string): () => any {
return async () => {
await db["api-tokens"].insert({
export function InsertFakeTokenWithAllPerms(token: string): () => Promise<any> {
return () =>
db["api-tokens"].insert({
userID: 1,
identifier: "Mock API Token",
permissions: ALL_PERMISSIONS,
token,
fromAPIClient: null,
});
};
}