feat: add async suffix eslint rule (#485)

This commit is contained in:
Manuel
2024-05-18 12:25:33 +02:00
committed by GitHub
parent 5723295856
commit dcaff1d91c
60 changed files with 296 additions and 225 deletions

View File

@@ -27,14 +27,14 @@ describe("initUser should initialize the first user", () => {
password: "test",
});
const act = async () =>
const actAsync = async () =>
await caller.initUser({
username: "test",
password: "12345678",
confirmPassword: "12345678",
});
await expect(act()).rejects.toThrow("User already exists");
await expect(actAsync()).rejects.toThrow("User already exists");
});
it("should create a user if none exists", async () => {
@@ -66,14 +66,14 @@ describe("initUser should initialize the first user", () => {
session: null,
});
const act = async () =>
const actAsync = async () =>
await caller.initUser({
username: "test",
password: "12345678",
confirmPassword: "12345679",
});
await expect(act()).rejects.toThrow("Passwords do not match");
await expect(actAsync()).rejects.toThrow("Passwords do not match");
});
it("should not create a user if the password is too short", async () => {
@@ -83,14 +83,14 @@ describe("initUser should initialize the first user", () => {
session: null,
});
const act = async () =>
const actAsync = async () =>
await caller.initUser({
username: "test",
password: "1234567",
confirmPassword: "1234567",
});
await expect(act()).rejects.toThrow("too_small");
await expect(actAsync()).rejects.toThrow("too_small");
});
});
@@ -175,7 +175,7 @@ describe("register should create a user with valid invitation", () => {
});
// Act
const act = async () =>
const actAsync = async () =>
await caller.register({
inviteId,
token: inviteToken,
@@ -186,7 +186,7 @@ describe("register should create a user with valid invitation", () => {
});
// Assert
await expect(act()).rejects.toThrow("Invalid invite");
await expect(actAsync()).rejects.toThrow("Invalid invite");
},
);
});