From 78caf995ac1a48ad01c76d94d0729713b24fa7cd Mon Sep 17 00:00:00 2001 From: Pedro Ramos Date: Fri, 12 Apr 2024 06:20:25 +0200 Subject: [PATCH] test: refactor tests for 'analytics' command (#1344) --- test/helpers/index.ts | 5 ----- test/integration/config/analytics.test.ts | 6 ++---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/test/helpers/index.ts b/test/helpers/index.ts index 06d01cdc406..65589b69ecd 100644 --- a/test/helpers/index.ts +++ b/test/helpers/index.ts @@ -8,7 +8,6 @@ import rimraf from 'rimraf'; const ASYNCAPI_FILE_PATH = path.resolve(process.cwd(), 'specification.yaml'); const SERVER_DIRECTORY= path.join(__dirname, '../fixtures/dummyspec'); export const PROJECT_DIRECTORY_PATH = path.join(process.cwd(), 'test-project'); -export const ANALYTICS_CONFIG_FILE_PATH = path.resolve(process.cwd(), '.asyncapi-analytics'); let server: http.Server; @@ -87,10 +86,6 @@ export default class ContextTestingHelper { deleteDummyProjectDirectory(): void { rimraf.sync(PROJECT_DIRECTORY_PATH); } - - deleteAnalyticsConfigFile(): void { - unlinkSync(ANALYTICS_CONFIG_FILE_PATH); - } } export function fileCleanup(filepath: string) { diff --git a/test/integration/config/analytics.test.ts b/test/integration/config/analytics.test.ts index cc33362031e..8f5ae75183d 100644 --- a/test/integration/config/analytics.test.ts +++ b/test/integration/config/analytics.test.ts @@ -1,11 +1,9 @@ import { expect, test } from '@oclif/test'; -import TestHelper from '../../helpers'; - -const testHelper = new TestHelper(); +import { fileCleanup } from '../../helpers'; describe('config:analytics', () => { afterEach(() => { - testHelper.deleteAnalyticsConfigFile(); + fileCleanup('.asyncapi-analytics'); }); describe('with disable flag', () => {