diff --git a/packages/cli-repl/src/setup-logger-and-telemetry.spec.ts b/packages/cli-repl/src/setup-logger-and-telemetry.spec.ts index 28f4a8ae83..4a1b67488d 100644 --- a/packages/cli-repl/src/setup-logger-and-telemetry.spec.ts +++ b/packages/cli-repl/src/setup-logger-and-telemetry.spec.ts @@ -243,7 +243,7 @@ describe('setupLoggerAndTelemetry', () => { it('buffers deprecated API calls', () => { setupLoggerAndTelemetry(logId, bus, () => logger, () => analytics); - expect(logOutput).to.be.empty; + expect(logOutput).to.have.lengthOf(1); expect(analyticsOutput).to.be.empty; const mongosh_version = require('../package.json').version; diff --git a/packages/shell-api/src/decorators.ts b/packages/shell-api/src/decorators.ts index df110b3d3e..9751de5c59 100644 --- a/packages/shell-api/src/decorators.ts +++ b/packages/shell-api/src/decorators.ts @@ -181,7 +181,7 @@ function wrapWithApiChecks any>(fn: T, className: s } function checkForDeprecation(internalState: ShellInternalState | undefined, className: string, fn: any) { - if (internalState && typeof fn === 'function' && fn.deprecated) { + if (internalState && typeof internalState.emitDeprecatedApiCall === 'function' && typeof fn === 'function' && fn.deprecated) { internalState.emitDeprecatedApiCall({ method: fn.name, class: className