diff --git a/src/output/__tests__/factory.test.ts b/src/output/__tests__/factory.test.ts index 52c2f59..671bb4f 100644 --- a/src/output/__tests__/factory.test.ts +++ b/src/output/__tests__/factory.test.ts @@ -7,6 +7,9 @@ import { indexerDeduplicationStrategy, tableStorageDeduplicationStrategy } from "../service"; +import * as TU from "../../utils/tableStorage"; +import { TableClient } from "@azure/data-tables"; + describe("getDeduplicationStrategy", () => { afterEach(() => { jest.clearAllMocks(); @@ -28,9 +31,11 @@ describe("getDeduplicationStrategy", () => { }); it("should return tablestorage deduplication strategy", () => { + jest.spyOn(TU, "getTableClient").mockImplementation(() => () => ({}) as TableClient); const strategyType = DeduplicationStrategyType.TableStorage; const strategy = getDeduplicationStrategy({ type: strategyType, + tableName: "tableName" as NonEmptyString, storageConnectionString: "foo" as NonEmptyString }); expect(strategy).toBeDefined();