mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 06:01:28 +08:00
update tests
This commit is contained in:
parent
ad30e1fb8f
commit
3e1df8fee3
2 changed files with 14 additions and 4 deletions
|
|
@ -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 () => {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue