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

@@ -9,7 +9,10 @@ import { throwIfActionForbiddenAsync } from "../../board/board-access";
const defaultCreatorId = createId();
const expectActToBe = async (act: () => Promise<void>, success: boolean) => {
const expectActToBeAsync = async (
act: () => Promise<void>,
success: boolean,
) => {
if (!success) {
await expect(act()).rejects.toThrow("Board not found");
return;
@@ -55,7 +58,7 @@ describe("throwIfActionForbiddenAsync should check access to board and return bo
);
// Assert
await expectActToBe(act, expectedResult);
await expectActToBeAsync(act, expectedResult);
},
);
@@ -92,7 +95,7 @@ describe("throwIfActionForbiddenAsync should check access to board and return bo
);
// Assert
await expectActToBe(act, expectedResult);
await expectActToBeAsync(act, expectedResult);
},
);
@@ -129,7 +132,7 @@ describe("throwIfActionForbiddenAsync should check access to board and return bo
);
// Assert
await expectActToBe(act, expectedResult);
await expectActToBeAsync(act, expectedResult);
},
);
@@ -166,7 +169,7 @@ describe("throwIfActionForbiddenAsync should check access to board and return bo
);
// Assert
await expectActToBe(act, expectedResult);
await expectActToBeAsync(act, expectedResult);
},
);