Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor tests for 'analytics' command #1344

Merged
merged 6 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading