From c767b5924c25e9c65098452c4eda88bdb7c28dd1 Mon Sep 17 00:00:00 2001 From: Pavithra Ramesh Date: Tue, 6 Dec 2022 13:29:58 -0800 Subject: [PATCH 1/2] Fix type error in totp unit test. --- packages/auth/src/mfa/assertions/totp.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/src/mfa/assertions/totp.test.ts b/packages/auth/src/mfa/assertions/totp.test.ts index e30e85ad5e2..69b9b79667e 100644 --- a/packages/auth/src/mfa/assertions/totp.test.ts +++ b/packages/auth/src/mfa/assertions/totp.test.ts @@ -93,7 +93,7 @@ describe('core/mfa/assertions/totp/TotpMultiFactorGenerator', () => { ); await TotpMultiFactorGenerator.generateSecret(session); } catch (e) { - expect(e.code).to.eql(`auth/${AuthErrorCode.INTERNAL_ERROR}`); + expect((e as any).code).to.eql(`auth/${AuthErrorCode.INTERNAL_ERROR}`); } }); it('generateSecret should generate a valid secret by starting enrollment', async () => { From 966064510438aaae1006f5da5595e37dff8b1630 Mon Sep 17 00:00:00 2001 From: Pavithra Ramesh Date: Tue, 6 Dec 2022 15:27:39 -0800 Subject: [PATCH 2/2] add ts-ignore for totp-generator. --- .../auth/test/helpers/integration/helpers.ts | 1 + packages/auth/totp-generator.d.ts | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 packages/auth/totp-generator.d.ts diff --git a/packages/auth/test/helpers/integration/helpers.ts b/packages/auth/test/helpers/integration/helpers.ts index 836de2af62f..b03a49d8678 100644 --- a/packages/auth/test/helpers/integration/helpers.ts +++ b/packages/auth/test/helpers/integration/helpers.ts @@ -23,6 +23,7 @@ import { getAuth, connectAuthEmulator } from '../../../'; // Use browser OR node import { _generateEventId } from '../../../src/core/util/event_id'; import { getAppConfig, getEmulatorUrl } from './settings'; import { resetEmulator } from './emulator_rest_helpers'; +// @ts-ignore - ignore types since this is only used in tests. import totp from 'totp-generator'; interface IntegrationTestAuth extends Auth { cleanUp(): Promise; diff --git a/packages/auth/totp-generator.d.ts b/packages/auth/totp-generator.d.ts deleted file mode 100644 index 01defa03c6a..00000000000 --- a/packages/auth/totp-generator.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -declare module 'totp-generator';