botium-core 1.13.8 → 1.13.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/botium-cjs.js +212 -1481
  2. package/dist/botium-cjs.js.map +1 -1
  3. package/dist/botium-es.js +212 -1481
  4. package/dist/botium-es.js.map +1 -1
  5. package/package.json +24 -24
  6. package/src/scripting/Convo.js +42 -15
  7. package/src/scripting/MatchFunctions.js +3 -4
  8. package/src/scripting/ScriptingProvider.js +9 -6
  9. package/src/scripting/helper.js +61 -2
  10. package/src/scripting/logichook/asserter/JsonPathAsserter.js +1 -1
  11. package/src/scripting/logichook/asserter/WerAsserter.js +3 -2
  12. package/src/scripting/logichook/logichooks/SetScriptingMemoryLogicHook.js +1 -1
  13. package/test/convo/convos/applyscriptingmemoryinbegin.convo.txt +14 -0
  14. package/test/convo/fillAndApplyScriptingMemory.spec.js +20 -0
  15. package/test/scripting/asserters/convos/wer_threshold_wildcard_nok_float.yml +7 -0
  16. package/test/scripting/asserters/convos/wer_threshold_wildcard_nok_percentage.yml +7 -0
  17. package/test/scripting/asserters/convos/wer_threshold_wildcard_ok_float.yml +7 -0
  18. package/test/scripting/asserters/convos/wer_threshold_wildcard_ok_percentage.yml +7 -0
  19. package/test/scripting/asserters/jsonpathAsserter.spec.js +11 -0
  20. package/test/scripting/asserters/werAsserter.spec.js +41 -0
  21. package/test/scripting/matching/matchingmode.spec.js +82 -0
  22. package/test/scripting/scriptingModificator.spec.js +2 -0
  23. package/test/scripting/scriptingmemory/convosPartial/buy.convo.txt +7 -0
  24. package/test/scripting/scriptingmemory/convosPartial/product.scriptingmemory.txt +2 -0
  25. package/test/scripting/scriptingmemory/convosPartial/sub1.pconvo.txt +7 -0
  26. package/test/scripting/scriptingmemory/convosPartial/sub2.pconvo.txt +7 -0
  27. package/test/scripting/scriptingmemory/fillScriptingMemoryFromFile.spec.js +10 -1
@@ -9,7 +9,7 @@ const echoConnector = ({ queueBotSays }) => {
9
9
  const response = `You said: ${msg.messageText.replace('forcereplace1', 'OUTPUT1').replace('forcereplace2', 'OUTPUT2')}`
10
10
  const botMsg = {
11
11
  sender: 'bot',
12
- sourceData: msg.sourceData,
12
+ sourceData: msg.sourceData || { request: msg.messageText },
13
13
  messageText: response
14
14
  }
15
15
  queueBotSays(botMsg)
@@ -289,6 +289,15 @@ describe('scripting.scriptingmemory.fillingScriptingMemoryFromFile', function ()
289
289
  this.compiler.ExpandScriptingMemoryToConvos()
290
290
  assert.equal(this.compiler.convos.length, 1)
291
291
  })
292
+
293
+ it('should replace scripting memory in partial convo', async function () {
294
+ this.compiler.ReadScriptsFromDirectory(path.resolve(__dirname, 'convosPartial'))
295
+ this.compiler.ExpandScriptingMemoryToConvos()
296
+ this.compiler.ExpandConvos()
297
+ assert.equal(this.compiler.convos.length, 1)
298
+
299
+ await this.compiler.convos[0].Run(this.container)
300
+ })
292
301
  })
293
302
 
294
303
  describe('memoryenabled.originalkept', function () {