Skip to content

Commit

Permalink
Refactor tests for 'analytics' command
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-rr committed Apr 4, 2024
1 parent ba5f788 commit 6a9a9f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions test/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/config/analytics.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect, test } from '@oclif/test';
import TestHelper from '../../helpers';
import TestHelper, { fileCleanup } from '../../helpers';

const testHelper = new TestHelper();

describe('config:analytics', () => {
afterEach(() => {
testHelper.deleteAnalyticsConfigFile();
fileCleanup('.asyncapi-analytics');
});

describe('with disable flag', () => {
Expand Down

0 comments on commit 6a9a9f1

Please sign in to comment.