diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json index ad5d219f47b9fdd9a5181cedea86556b8b50a334..5e6d49418066f6aa853f558010aa99611087d2b6 100644 --- a/tests/.eslintrc.json +++ b/tests/.eslintrc.json @@ -17,6 +17,7 @@ "rules": { "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-assignment": "off" + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/require-await": "off" } } diff --git a/tests/tests/messages/statelessCommands.ts b/tests/tests/messages/statelessCommands.ts index c75bf41302b3a2614e94dacddbe53c3c15649906..526949e6cd41d317a770581ccc8fa3b095f51795 100644 --- a/tests/tests/messages/statelessCommands.ts +++ b/tests/tests/messages/statelessCommands.ts @@ -49,7 +49,7 @@ describe('statelessCommands', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.goodAfternoon.process(author)); called = true; @@ -72,7 +72,7 @@ describe('statelessCommands', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.goodMorning.process(author)); called = true; @@ -95,7 +95,7 @@ describe('statelessCommands', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.goodNight.process(author)); called = true; @@ -118,7 +118,7 @@ describe('statelessCommands', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.hello.process(author)); called = true; @@ -141,7 +141,7 @@ describe('statelessCommands', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.maybeResponse.process(author)); called = true; diff --git a/tests/tests/wichtelbot.message.handler.ts b/tests/tests/wichtelbot.message.handler.ts index a380c0d912fdce089d692585f99a3b839e2212df..b68a58e22f8858ee1ca5b6eb8e01197054dd4c92 100644 --- a/tests/tests/wichtelbot.message.handler.ts +++ b/tests/tests/wichtelbot.message.handler.ts @@ -46,7 +46,7 @@ describe('message handler', it('does not answer bots.', async function () { - const resultCallback = async (): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (): Promise<void> => { assert.fail('The bot must not answer bot messages!'); }; @@ -62,7 +62,7 @@ describe('message handler', it('does not answer in ignored channel types.', async function () { - const resultCallback = async (): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (): Promise<void> => { assert.fail('The bot must not answer in ignored channels!'); }; @@ -78,7 +78,7 @@ describe('message handler', it('does not answer non-prefixed server messages.', async function () { - const resultCallback = async (): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (): Promise<void> => { assert.fail('The bot must not answer non-prefixed server messages!'); }; @@ -98,7 +98,7 @@ describe('message handler', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.contactingRegistration.process(author)); called = true; @@ -119,7 +119,7 @@ describe('message handler', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { assert.strictEqual(text, Localisation.texts.notUnderstood.process(author)); called = true; @@ -140,7 +140,7 @@ describe('message handler', let called = false; let author: User; - const resultCallback = async (text: string): Promise<void> => // eslint-disable-line @typescript-eslint/require-await + const resultCallback = async (text: string): Promise<void> => { const parameters = new KeyValuePairList(); parameters.addPair('messageLength', `${message.content.length}`); diff --git a/tests/utility/message.ts b/tests/utility/message.ts index cc314843ebc0ec1c3653918cb39bc1810408c847..9975ddf0ed17342100c0d6068fe1200e6e0ef4a3 100644 --- a/tests/utility/message.ts +++ b/tests/utility/message.ts @@ -84,7 +84,6 @@ export class CommandTestMessage extends TestMessage constructor (database: Database, testCallback: TestCallbackContact | TestCallbackMember, channelType: ChannelType) { - // eslint-disable-next-line @typescript-eslint/require-await const resultCallback = async (text: string): Promise<void> => { this.called = true;