Skip to content

Commit

Permalink
Solve linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-rr committed Feb 28, 2024
1 parent e51dcc3 commit 0f3da30
Showing 1 changed file with 36 additions and 41 deletions.
77 changes: 36 additions & 41 deletions test/integration/config/analytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,43 @@ import TestHelper from '../../helpers';
const testHelper = new TestHelper();

describe('config:analytics', () => {
afterEach(() => {
try {
testHelper.deleteAnalyticsConfigFile();
} catch (e: any) {
throw e;
}
});
afterEach(() => {
testHelper.deleteAnalyticsConfigFile();
});

describe('with disable flag', () => {
test
.stderr()
.stdout()
.command(['config:analytics', '--disable'])
.it('should show a successful message once the analytics are disabled', async (ctx, done) => {
expect(ctx.stdout).to.equal('Analytics disabled.\n');
expect(ctx.stderr).to.equal('');
done();
});
});
describe('with disable flag', () => {
test
.stderr()
.stdout()
.command(['config:analytics', '--disable'])
.it('should show a successful message once the analytics are disabled', async (ctx, done) => {
expect(ctx.stdout).to.equal('Analytics disabled.\n');
expect(ctx.stderr).to.equal('');
done();
});
});

describe('with enable flag', () => {
test
.stderr()
.stdout()
.command(['config:analytics', '--enable'])
.it('should show a successful message once the analytics are enabled', (ctx, done) => {
expect(ctx.stdout).to.equal('Analytics enabled.\n');
expect(ctx.stderr).to.equal('');
done();
});
});
describe('with enable flag', () => {
test
.stderr()
.stdout()
.command(['config:analytics', '--enable'])
.it('should show a successful message once the analytics are enabled', (ctx, done) => {
expect(ctx.stdout).to.equal('Analytics enabled.\n');
expect(ctx.stderr).to.equal('');
done();
});
});

describe('with no flags', () => {
test
.stderr()
.stdout()
.command(['config:analytics'])
.it('should show informational message when no flags are used', (ctx, done) => {
expect(ctx.stdout).to.equal('\nPlease append the "--disable" flag to the command in case you prefer to disable analytics, or use the "--enable" flag if you want to enable analytics back again.\n\n');
expect(ctx.stderr).to.equal('');
done();
});
});
describe('with no flags', () => {
test
.stderr()
.stdout()
.command(['config:analytics'])
.it('should show informational message when no flags are used', (ctx, done) => {
expect(ctx.stdout).to.equal('\nPlease append the "--disable" flag to the command in case you prefer to disable analytics, or use the "--enable" flag if you want to enable analytics back again.\n\n');
expect(ctx.stderr).to.equal('');
done();
});
});
});

0 comments on commit 0f3da30

Please sign in to comment.