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

Fixes collecting telemetry #6603

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/docs/contribute/new-command/unit-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe(commands.GROUP_GET, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.connection.active = true;
Expand Down
3 changes: 2 additions & 1 deletion src/Command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ describe('Command', () => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').callsFake((commandName) => {
telemetryCommandName = commandName;
return Promise.resolve();
});
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
Expand Down Expand Up @@ -610,7 +611,7 @@ describe('Command', () => {
}
];
const actual = await command.getCsvOutput(commandOutput, { options: { output: 'csv' } });
assert.strictEqual(actual,"property1,property2\n1,0\n");
assert.strictEqual(actual, "property1,property2\n1,0\n");
});

it('passes validation when csv output specified', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ export default abstract class Command {
await logger.logToStderr(`Executing command as '${auth.connection.identityName}', appId: ${auth.connection.appId}, tenantId: ${auth.connection.identityTenantId}`);
}

telemetry.trackEvent(this.getUsedCommandName(), this.getTelemetryProperties(args));
await telemetry.trackEvent(this.getUsedCommandName(), this.getTelemetryProperties(args));
}

protected getUnknownOptions(options: any): any {
Expand Down
2 changes: 2 additions & 0 deletions src/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 'none';
// prevents tests from hanging
process.env.APPLICATION_INSIGHTS_NO_STATSBEAT = 'true';
// suppress all logging
process.env.APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL = 'NONE';
import * as appInsights from 'applicationinsights';
import crypto from 'crypto';
import fs from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ describe('cli', () => {
let mockCommandWithBooleanRewrite: Command;

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');

Expand Down
2 changes: 1 addition & 1 deletion src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ async function printHelp(helpMode: string, exitCode: number = 0): Promise<void>
cli.printAvailableCommands();
}

telemetry.trackEvent('help', properties);
await telemetry.trackEvent('help', properties);

process.exit(exitCode);
}
Expand Down
2 changes: 1 addition & 1 deletion src/m365/adaptivecard/commands/adaptivecard-send.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe(commands.SEND, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
commandInfo = cli.getCommandInfo(command);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/app/commands/app-get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(commands.GET, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
sinon.stub(fs, 'existsSync').returns(true);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/app/commands/app-open.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe(commands.OPEN, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/app/commands/permission/permission-add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe(commands.PERMISSION_ADD, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
sinon.stub(fs, 'existsSync').returns(true);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/app/commands/permission/permission-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe(commands.PERMISSION_LIST, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
sinon.stub(fs, 'existsSync').returns(true);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/AppCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('AppCommand', () => {

before(() => {
commandInfo = cli.getCommandInfo(new MockCommand());
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/ContextCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('ContextCommand', () => {
const contextInfo: Hash = {};

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/DateAndPeriodBasedReport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('PeriodBasedReport', () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/DelegatedGraphCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('DelegatedGraphCommand', () => {
const cmd = new MockCommand();

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
auth.connection.active = true;
auth.connection.accessTokens[auth.defaultResource] = {
expiresOn: 'abc',
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/GraphCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MockCommand extends GraphCommand {

describe('GraphCommand', () => {
before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/PeriodBasedReport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('PeriodBasedReport', () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/PowerAppsCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('PowerAppsCommand', () => {
const cloudError = new CommandError(`Power Apps commands only support the public cloud at the moment. We'll add support for other clouds in the future. Sorry for the inconvenience.`);

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false);
auth.connection.active = true;
auth.connection.accessTokens[auth.defaultResource] = {
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/PowerAutomateCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('PowerAutomateCommand', () => {
const cloudError = new CommandError(`Power Automate commands only support the public cloud at the moment. We'll add support for other clouds in the future. Sorry for the inconvenience.`);

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false);
auth.connection.active = true;
auth.connection.accessTokens[auth.defaultResource] = {
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/PowerBICommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MockCommand extends PowerBICommand {

describe('PowerBICommand', () => {
before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/PowerPlatformCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('PowerPlatformCommand', () => {
const cloudError = new CommandError(`Power Platform commands only support the public cloud at the moment. We'll add support for other clouds in the future. Sorry for the inconvenience.`);

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false);
auth.connection.active = true;
auth.connection.accessTokens[auth.defaultResource] = {
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/SpoCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('SpoCommand', () => {

before(() => {
auth.connection.active = true;
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/base/VivaEngageCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MockCommand extends VivaEngageCommand {

describe('VivaEngageCommand', () => {
before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/booking/commands/business/business-get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe(commands.BUSINESS_GET, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');

Expand Down
2 changes: 1 addition & 1 deletion src/m365/booking/commands/business/business-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(commands.BUSINESS_LIST, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/cli-consent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe(commands.CONSENT, () => {
let commandInfo: CommandInfo;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
commandInfo = cli.getCommandInfo(command);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/cli-doctor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe(commands.DOCTOR, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').callsFake(() => Promise.resolve());
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/cli-issue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(commands.ISSUE, () => {
let openStub: sinon.SinonStub;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
(command as any).open = () => { };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe(commands.COMPLETION_CLINK_UPDATE, () => {
let generateClinkCompletionStub: sinon.SinonStub;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
generateClinkCompletionStub = sinon.stub(autocomplete, 'getClinkCompletion').callsFake(() => '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe(commands.COMPLETION_PWSH_SETUP, () => {
let loggerLogToStderrSpy: sinon.SinonSpy;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
sinon.stub(autocomplete, 'generateShCompletion').callsFake(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe(commands.COMPLETION_PWSH_UPDATE, () => {
let generateShCompletionStub: sinon.SinonStub;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
generateShCompletionStub = sinon.stub(autocomplete, 'generateShCompletion').callsFake(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe(commands.COMPLETION_SH_SETUP, () => {
let setupShCompletionStub: sinon.SinonStub;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
generateShCompletionStub = sinon.stub(autocomplete, 'generateShCompletion').callsFake(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe(commands.COMPLETION_SH_UPDATE, () => {
let generateShCompletionStub: sinon.SinonStub;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
generateShCompletionStub = sinon.stub(autocomplete, 'generateShCompletion').callsFake(() => { });
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/config/config-get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe(commands.CONFIG_GET, () => {

before(() => {
commandInfo = cli.getCommandInfo(command);
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/config/config-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe(commands.CONFIG_LIST, () => {
let loggerSpy: sinon.SinonSpy;

before(() => {
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/config/config-reset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe(commands.CONFIG_RESET, () => {

before(() => {
commandInfo = cli.getCommandInfo(command);
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/cli/commands/config/config-set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(commands.CONFIG_SET, () => {

before(() => {
commandInfo = cli.getCommandInfo(command);
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/commands/docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(commands.DOCS, () => {
let getSettingWithDefaultValueStub: sinon.SinonStub;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/commands/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(commands.LOGIN, () => {
sinon.stub(auth, 'restoreAuth').callsFake(() => Promise.resolve());
sinon.stub(auth, 'clearConnectionInfo').callsFake(() => Promise.resolve());
sinon.stub(auth, 'storeConnectionInfo').callsFake(() => Promise.resolve());
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
commandInfo = cli.getCommandInfo(command);
Expand Down
2 changes: 1 addition & 1 deletion src/m365/commands/logout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(commands.LOGOUT, () => {
before(() => {
sinon.stub(auth, 'restoreAuth').callsFake(() => Promise.resolve());
authClearConnectionInfoStub = sinon.stub(auth, 'clearConnectionInfo').callsFake(() => Promise.resolve());
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
});
Expand Down
2 changes: 1 addition & 1 deletion src/m365/commands/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe(commands.REQUEST, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').callsFake(() => Promise.resolve());
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/commands/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ describe(commands.SEARCH, () => {

before(() => {
sinon.stub(auth, 'restoreAuth').resolves();
sinon.stub(telemetry, 'trackEvent').returns();
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.connection.active = true;
Expand Down
2 changes: 1 addition & 1 deletion src/m365/commands/setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(commands.SETUP, () => {
let configDeleteSpy: sinon.SinonSpy;

before(() => {
sinon.stub(telemetry, 'trackEvent').callsFake(() => { });
sinon.stub(telemetry, 'trackEvent').resolves();
sinon.stub(pid, 'getProcessName').callsFake(() => '');
sinon.stub(session, 'getId').callsFake(() => '');
commandInfo = cli.getCommandInfo(command);
Expand Down
Loading
Loading