From 2565622cb17de504c4c790677aa86782cc3822ef Mon Sep 17 00:00:00 2001 From: mdolhalo Date: Thu, 5 Oct 2023 12:13:46 +0200 Subject: [PATCH] fix: eslint issues Signed-off-by: mdolhalo --- tests/e2e/utils/CheReporter.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/e2e/utils/CheReporter.ts b/tests/e2e/utils/CheReporter.ts index 5b7f6b9c1823..651af1652855 100644 --- a/tests/e2e/utils/CheReporter.ts +++ b/tests/e2e/utils/CheReporter.ts @@ -7,6 +7,9 @@ * * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import * as chromeHar from 'chrome-har'; import * as mocha from 'mocha'; import { CLASSES } from '../configs/inversify.types'; import * as fs from 'fs'; @@ -26,8 +29,6 @@ import { PLUGIN_TEST_CONSTANTS } from '../constants/PLUGIN_TEST_CONSTANTS'; import { injectable } from 'inversify'; import getDecorators from 'inversify-inject-decorators'; import { e2eContainer } from '../configs/inversify.config'; -// @ts-ignore: No module declaration file -import * as chromeHar from 'chrome-har'; const { lazyInject } = getDecorators(e2eContainer); @@ -67,7 +68,7 @@ class CheReporter extends mocha.reporters.Spec { TS_SAMPLE_LIST: ${PLUGIN_TEST_CONSTANTS.TS_SAMPLE_LIST} - ${process.env.MOCHA_DIRECTORY ? 'MOCHA_DIRECTORY: ' + process.env.MOCHA_DIRECTORY : 'MOCHA_DRIRECTORY is not set'} + ${process.env.MOCHA_DIRECTORY ? 'MOCHA_DIRECTORY: ' + process.env.MOCHA_DIRECTORY : 'MOCHA_DIRECTORY is not set'} ${process.env.USERSTORY ? 'USERSTORY: ' + process.env.USERSTORY : 'USERSTORY is not set'} `; @@ -178,8 +179,8 @@ class CheReporter extends mocha.reporters.Spec { // take networking logs and write to file const networkLogsEntries: logging.Entry[] = await this.driverHelper.getDriver().manage().logs().get('performance'); - const events = networkLogsEntries.map((entry) => JSON.parse(entry.message).message); - const har = chromeHar.harFromMessages(events, { includeTextFromResponseBody: true }); + const events: any[] = networkLogsEntries.map((entry): any[] => JSON.parse(entry.message).message); + const har: any = chromeHar.harFromMessages(events, { includeTextFromResponseBody: true }); const networkLogsStream: WriteStream = fs.createWriteStream(harFileName); networkLogsStream.write(Buffer.from(JSON.stringify(har)), (): void => { networkLogsStream.end();