Resolve "Transition to ESLint"

This commit is contained in:
Thea Schöbl
2022-06-27 14:40:09 +00:00
committed by Rainer Killinger
parent ca1d2444e0
commit 418ba67d15
47 changed files with 1854 additions and 1634 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/*
* Copyright (C) 2020 StApps
* This program is free software: you can redistribute it and/or modify
@@ -37,7 +38,7 @@ describe('MailQueue', async function () {
it('should fail after maximal number of verification checks', function () {
const loggerStub = sandbox.spy(Logger, 'warn');
const test = () => {
// @ts-ignore
// @ts-expect-error not assignable
new MailQueue(getTransport(false));
// fake that VERIFICATION_TIMEOUT was reached more times (one more) than MAX_VERIFICATION_ATTEMPTS
clock.tick(MailQueue.VERIFICATION_TIMEOUT * (MailQueue.MAX_VERIFICATION_ATTEMPTS + 1));
@@ -50,8 +51,8 @@ describe('MailQueue', async function () {
it('should add queued mails to the queue for sending when transport is verified', async function () {
const queueAddStub = sandbox.stub(Queue.prototype, 'add');
const numberOfMails = 3;
let transport = getTransport(false);
// @ts-ignore
const transport = getTransport(false);
// @ts-expect-error not assignable
const mailQueue = new MailQueue(transport);
const mail: MailOptions = {from: 'Foo', subject: 'Foo Subject'};
for (let i = 0; i < numberOfMails; i++) {
@@ -67,7 +68,7 @@ describe('MailQueue', async function () {
it('should not add SMTP sending tasks to queue when transport is not verified', function () {
const queueAddStub = sandbox.stub(Queue.prototype, 'add');
// @ts-ignore
// @ts-expect-error not assignable
const mailQueue = new MailQueue(getTransport(false));
const mail: MailOptions = {};
mailQueue.push(mail);
@@ -77,8 +78,8 @@ describe('MailQueue', async function () {
it('should add SMTP sending tasks to queue when transport is verified', function () {
const queueAddStub = sandbox.stub(Queue.prototype, 'add');
let transport = getTransport(false);
// @ts-ignore
const transport = getTransport(false);
// @ts-expect-error not assignable
const mailQueue = new MailQueue(transport);
const mail: MailOptions = {from: 'Foo', subject: 'Foo Subject'};
// fake that transport is verified
@@ -90,11 +91,11 @@ describe('MailQueue', async function () {
it('should send SMTP mails when transport is verified', async function () {
let caught: any;
sandbox.stub(Queue.prototype, 'add').callsFake(async (promiseGenerator) => {
sandbox.stub(Queue.prototype, 'add').callsFake(async promiseGenerator => {
caught = await promiseGenerator();
});
let transport = getTransport(false);
// @ts-ignore
const transport = getTransport(false);
// @ts-expect-error not assignable
const mailQueue = new MailQueue(transport);
const mail: MailOptions = {from: 'Foo', subject: 'Foo Subject'};
// fake that transport is verified