update tests

This commit is contained in:
Christian Fehmer 2025-08-18 12:17:41 +02:00
parent ad30e1fb8f
commit 3e1df8fee3
No known key found for this signature in database
GPG key ID: FE53784A69964062
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,12 @@
import {
describe,
it,
expect,
vi,
beforeAll,
beforeEach,
afterEach,
} from "vitest";
import { ObjectId } from "mongodb";
import * as FriendsDal from "../../../src/dal/friends";
@ -5,7 +14,7 @@ import { createUser, pb } from "../../__testData__/users";
describe("FriendsDal", () => {
beforeAll(async () => {
FriendsDal.createIndicies();
await FriendsDal.createIndicies();
});
describe("getRequests", () => {
@ -66,11 +75,11 @@ describe("FriendsDal", () => {
describe("create", () => {
const now = 1715082588;
beforeEach(() => {
vitest.useFakeTimers();
vitest.setSystemTime(now);
vi.useFakeTimers();
vi.setSystemTime(now);
});
afterEach(() => {
vitest.useRealTimers();
vi.useRealTimers();
});
it("should fail creating duplicates", async () => {

View file

@ -1,3 +1,4 @@
import { describe, expect, it, vi, beforeEach } from "vitest";
import request, { Test as SuperTest } from "supertest";
import app from "../../../src/app";
import { mockBearerAuthentication } from "../../__testData__/auth";