Skip to content

Commit

Permalink
test: refactor tests for 'analytics' command (#1344)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-rr authored Apr 12, 2024
1 parent 63a66eb commit 78caf99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 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
6 changes: 2 additions & 4 deletions test/integration/config/analytics.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down

0 comments on commit 78caf99

Please sign in to comment.