feat: add async suffix eslint rule (#485)
This commit is contained in:
@@ -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");
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user