diff --git a/Composer/packages/server/src/controllers/__tests__/publisher.test.ts b/Composer/packages/server/src/controllers/__tests__/publisher.test.ts index da0b8825a1..4516618170 100644 --- a/Composer/packages/server/src/controllers/__tests__/publisher.test.ts +++ b/Composer/packages/server/src/controllers/__tests__/publisher.test.ts @@ -1,17 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import path from 'path'; - import { Request, Response } from 'express'; import rimraf from 'rimraf'; -import { ExtensionManager } from '@bfc/extension'; import { BotProjectService } from '../../services/project'; import { Path } from '../../utility/path'; import { PublishController } from '../../controllers/publisher'; -const pluginDir = path.resolve(__dirname, '../../../../../../extensions'); +jest.mock('@bfc/extension', () => { + return { + ExtensionContext: { + extensions: { + botTemplates: [], + baseTemplates: [], + runtimeTemplates: [], + publish: { + azureplugin: { plugin: { name: 'azure' }, methods: {} }, + default: { plugin: { name: 'defalut' }, methods: {} }, + }, + }, + getUserFromRequest: jest.fn(), + }, + }; +}); let mockRes: Response; @@ -40,10 +52,6 @@ beforeEach(async () => { await BotProjectService.saveProjectAs(currentProject, location2); }); -beforeAll(async () => { - await ExtensionManager.loadFromDir(pluginDir, true); -}); - afterEach(() => { // remove the new bot files try {