diff --git a/libraries/botframework-config/package.json b/libraries/botframework-config/package.json index 22e8630954..375bf11621 100644 --- a/libraries/botframework-config/package.json +++ b/libraries/botframework-config/package.json @@ -2,7 +2,7 @@ "name": "botframework-config", "author": "Microsoft Corp.", "description": "library for working with Bot Framework .bot configuration files", - "version": "4.0.0-preview1.3.1", + "version": "4.0.0-preview1.3.2", "license": "MIT", "keywords": [ "bots", diff --git a/libraries/botframework-config/src/botConfiguration.ts b/libraries/botframework-config/src/botConfiguration.ts index c4c09cfebe..2c456ecb62 100644 --- a/libraries/botframework-config/src/botConfiguration.ts +++ b/libraries/botframework-config/src/botConfiguration.ts @@ -438,7 +438,7 @@ export class BotConfiguration extends BotConfigurationBase { console.warn(`WARNING: Generic services cannot be cloned and all configuration data will be passed unchanged and unencrypted `); let genericService = service; let genericResource: IGenericResource = { - type: ServiceTypes.File, + type: ServiceTypes.Generic, id: service.id, name: service.name, url: genericService.url, diff --git a/libraries/botframework-config/tests/export.test.js b/libraries/botframework-config/tests/export.test.js index 1d219832a7..8d7a9a2939 100644 --- a/libraries/botframework-config/tests/export.test.js +++ b/libraries/botframework-config/tests/export.test.js @@ -12,23 +12,25 @@ const saveBotPath = testBotPath.replace("test.bot", "save.bot"); describe("ExportTests", () => { it("ExportBot", async () => { var config = await bf.BotConfiguration.load(testBotPath); - let messages = []; + let services = []; let exportFolder = path.join(path.dirname(__filename),'exportfolder'); await config.export(exportFolder, { download: false, // disable download - progress: (service, command, index, total) => messages.push(service.name) + progress: (service, command, index, total) => services.push(service) }); for (let service of config.services) { let found = false; - for (let message of messages) { - if (message === service.name) { + for (let svc of services) { + if ((service.id === svc.id) && + (service.type === svc.type) && + (service.name === svc.name)) { found = true; break; } } - assert.ok(found, `${service.name} not sent as status`); + assert.ok(found, `${service.name} not published through progress`); } let recipePath = path.join(exportFolder, 'bot.recipe'); @@ -39,6 +41,19 @@ describe("ExportTests", () => { let recipe = bf.BotRecipe.fromJSON(JSON.parse(json)); assert.equal(config.services.length, recipe.resources.length, "service count not equal"); + for (let service of config.services) { + let found = false; + for (let resource of recipe.resources) { + if ((service.id === resource.id) && + (service.type === resource.type) && + (service.name === resource.name)) { + found = true; + break; + } + } + assert.ok(found, `${service.name} not exported correctly `); + } + let json2 = recipe.toJSON(); assert.deepEqual(json2, JSON.parse(json), "serialization diffeent");