From 0b5c95cc515da5312fdadc74687f44277912cac0 Mon Sep 17 00:00:00 2001 From: Matthew Schwartz Date: Thu, 5 Oct 2017 21:51:30 -0700 Subject: [PATCH 1/2] v3.2.0 (#36) --- README.md | 5 ++- ...ries_chaiexpectation_.chaiexpectation.html | 16 ++++---- docs/classes/_bottester_.bottester.html | 38 +++++++++---------- .../_expectedmessage_.expectedmessage.html | 14 +++---- .../_messageservice_.messageservice.html | 14 +++---- ...comparator_.outgoingmessagecomparator.html | 18 ++++----- .../_sessionservice_.sessionservice.html | 20 +++++----- .../_testconnector_.testconnector.html | 14 +++---- ..._expectedmessage_.expectedmessagetype.html | 6 +-- ...nlibraries_iexpectation_.iexpectation.html | 10 ++--- docs/interfaces/_bottester_.ibottester.html | 14 +++---- .../_bottester_.ioptionsmodifier.html | 8 ++-- docs/interfaces/_config_.iconfig.html | 29 +++++++++++--- .../_assertionlibraries_iexpectation_.html | 2 +- docs/modules/_bottester_.html | 2 +- docs/modules/_builtinmessagefilters_.html | 6 +-- docs/modules/_config_.html | 6 +-- docs/modules/_expectedmessage_.html | 4 +- docs/modules/_messageservice_.html | 2 +- package.json | 2 +- src/config.ts | 11 ++++++ 21 files changed, 137 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index 0dd3e7b..a41e10a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,10 @@ Passing in the config overrides any default values or values set by bot-tester.j // each filter returns false for messages that the BotTester should ignore messageFilters: ((message:IMessage) => boolean)[], ignoreTypingEvent: boolean, - ignoreEndOfConversationEvent: boolean + ignoreEndOfConversationEvent: boolean, + // Setting this to true will cause checkSession to hang and test to fail. + ignoreInternalSveMessage?: boolean; + } ``` if timeout is defined, then a particular ```runTest()``` call will fail if it does not receive each expected message within the timeout period of time set in the options. diff --git a/docs/classes/_assertionlibraries_chaiexpectation_.chaiexpectation.html b/docs/classes/_assertionlibraries_chaiexpectation_.chaiexpectation.html index cbb5966..ff334f6 100644 --- a/docs/classes/_assertionlibraries_chaiexpectation_.chaiexpectation.html +++ b/docs/classes/_assertionlibraries_chaiexpectation_.chaiexpectation.html @@ -130,7 +130,7 @@

constructor

  • Parameters

    @@ -155,7 +155,7 @@

    Private message

    message: string
    @@ -165,7 +165,7 @@

    Private subject

    subject: __type
    @@ -183,7 +183,7 @@

    notToBeEmpty

    Returns void

    @@ -201,7 +201,7 @@

    toBeTrue

    Returns void

    @@ -219,7 +219,7 @@

    toDeeplyInclude

    @@ -252,7 +252,7 @@

    toEqual

    Parameters

    @@ -276,7 +276,7 @@

    toInclude

    Parameters

    diff --git a/docs/classes/_bottester_.bottester.html b/docs/classes/_bottester_.bottester.html index 6b2c6ac..28a9a6f 100644 --- a/docs/classes/_bottester_.bottester.html +++ b/docs/classes/_bottester_.bottester.html @@ -142,7 +142,7 @@

    constructor

  • Parameters

    @@ -167,7 +167,7 @@

    Private bot

    bot: UniversalBot
    @@ -177,7 +177,7 @@

    Private config

    config: IConfig
    @@ -187,7 +187,7 @@

    Private messageService

    messageService: MessageService @@ -197,7 +197,7 @@

    Private sessionLoader

    sessionLoader: SessionService
    @@ -207,7 +207,7 @@

    Private testSteps

    testSteps: TestStep[]
    @@ -225,7 +225,7 @@

    addMessageFilter

    Parameters

    @@ -249,7 +249,7 @@

    checkSession

    Parameters

    @@ -275,7 +275,7 @@

    Private convertToIMessage<
  • Parameters

    @@ -299,7 +299,7 @@

    ignoreEndOfConversationEvent

    Returns BotTester

    @@ -317,7 +317,7 @@

    ignoreTypingEvent

    Returns BotTester

    @@ -335,7 +335,7 @@

    runTest

    @@ -358,7 +358,7 @@

    sendMessageToBot

    Parameters

    @@ -385,7 +385,7 @@

    sendMessageToBotAndExpectSaveWithNoRespon

    Parameters

    @@ -409,7 +409,7 @@

    sendMessageToBotIgnoringResponseOrder

    Parameters

    @@ -435,7 +435,7 @@

    Private sendMessageTo
  • @@ -476,7 +476,7 @@

    setTimeout

    Parameters

    @@ -500,7 +500,7 @@

    then

    Parameters

    @@ -524,7 +524,7 @@

    wait

    Parameters

    diff --git a/docs/classes/_expectedmessage_.expectedmessage.html b/docs/classes/_expectedmessage_.expectedmessage.html index 7f07cd8..e2bbbdf 100644 --- a/docs/classes/_expectedmessage_.expectedmessage.html +++ b/docs/classes/_expectedmessage_.expectedmessage.html @@ -124,7 +124,7 @@

    constructor

  • Parameters

    @@ -146,7 +146,7 @@

    Private expectedResponseexpectedResponseCollection: PossibleExpectedMessageCollections

  • @@ -168,7 +168,7 @@

    checkForMessageMatch

  • @@ -200,7 +200,7 @@

    Private checkMessageT
  • @@ -237,7 +237,7 @@

    Private checkMessageT
  • @@ -269,7 +269,7 @@

    Private deepMessageMa
  • @@ -303,7 +303,7 @@

    toString

  • Returns string

    diff --git a/docs/classes/_messageservice_.messageservice.html b/docs/classes/_messageservice_.messageservice.html index c13d979..c4bb41a 100644 --- a/docs/classes/_messageservice_.messageservice.html +++ b/docs/classes/_messageservice_.messageservice.html @@ -124,7 +124,7 @@

    constructor

  • Parameters

    @@ -149,7 +149,7 @@

    Private bot

    bot: UniversalBot
    @@ -159,7 +159,7 @@

    Private botToUserMess
    botToUserMessageChecker: botToUserMessageCheckerFunction
    @@ -169,7 +169,7 @@

    Private config

    config: IConfig
    @@ -186,7 +186,7 @@

    Private applyOutgoing
  • @@ -208,7 +208,7 @@

    sendMessageToBot

  • @@ -248,7 +248,7 @@

    Private setBotToUser<
  • diff --git a/docs/classes/_outgoingmessagecomparator_.outgoingmessagecomparator.html b/docs/classes/_outgoingmessagecomparator_.outgoingmessagecomparator.html index 259d1ef..9471a7e 100644 --- a/docs/classes/_outgoingmessagecomparator_.outgoingmessagecomparator.html +++ b/docs/classes/_outgoingmessagecomparator_.outgoingmessagecomparator.html @@ -125,7 +125,7 @@

    constructor

  • Parameters

    @@ -150,7 +150,7 @@

    Private expectedMessagesexpectedMessages: ExpectedMessage[]

  • @@ -160,7 +160,7 @@

    Private ignoreOrder

    ignoreOrder: boolean
    @@ -177,7 +177,7 @@

    compareOutgoingMessageToExpectedResponses

  • @@ -205,7 +205,7 @@

    Private compareOutgoing

    Parameters

    @@ -228,7 +228,7 @@

    Private compareOutgoing

    Parameters

    @@ -251,7 +251,7 @@

    Private dequeueNextEx
  • @@ -273,7 +273,7 @@

    expectsAdditionalMessages

  • @@ -295,7 +295,7 @@

    getTimeoutErrorMessage

  • Returns string

    diff --git a/docs/classes/_sessionservice_.sessionservice.html b/docs/classes/_sessionservice_.sessionservice.html index 3d8a7e1..3a698d3 100644 --- a/docs/classes/_sessionservice_.sessionservice.html +++ b/docs/classes/_sessionservice_.sessionservice.html @@ -126,7 +126,7 @@

    constructor

  • Parameters

    @@ -148,7 +148,7 @@

    Private bot

    bot: UniversalBot
    @@ -158,7 +158,7 @@

    Private currentSessioncurrentSessionLoadResolver: function

  • @@ -189,7 +189,7 @@

    Private savePerformed

    savePerformed: Promise<any>
    @@ -214,7 +214,7 @@

    Private applySessionL
  • @@ -238,7 +238,7 @@

    Private applySessionS
  • @@ -263,7 +263,7 @@

    Private createSession
  • @@ -296,7 +296,7 @@

    getInternalSaveMessage

  • @@ -329,7 +329,7 @@

    getSession

  • @@ -360,7 +360,7 @@

    Private loadSession

  • diff --git a/docs/classes/_testconnector_.testconnector.html b/docs/classes/_testconnector_.testconnector.html index 269afb5..33ee3ac 100644 --- a/docs/classes/_testconnector_.testconnector.html +++ b/docs/classes/_testconnector_.testconnector.html @@ -122,7 +122,7 @@

    constructor

  • Returns TestConnector

    @@ -138,7 +138,7 @@

    Private newConvoCount
    newConvoCount: number
    @@ -148,7 +148,7 @@

    Private onEventHandle
    onEventHandler: function
    @@ -200,7 +200,7 @@

    Private onInvokeHandl
    onInvokeHandler: function
    @@ -265,7 +265,7 @@

    onEvent

  • Parameters

    @@ -327,7 +327,7 @@

    send

  • Parameters

    @@ -374,7 +374,7 @@

    startConversation

  • Parameters

    diff --git a/docs/enums/_expectedmessage_.expectedmessagetype.html b/docs/enums/_expectedmessage_.expectedmessagetype.html index 9cbe1ef..ab10ccf 100644 --- a/docs/enums/_expectedmessage_.expectedmessagetype.html +++ b/docs/enums/_expectedmessage_.expectedmessagetype.html @@ -90,7 +90,7 @@

    IMessage

    IMessage:
    @@ -100,7 +100,7 @@

    Regex

    Regex:
    @@ -110,7 +110,7 @@

    String

    String:
    diff --git a/docs/interfaces/_assertionlibraries_iexpectation_.iexpectation.html b/docs/interfaces/_assertionlibraries_iexpectation_.iexpectation.html index d220e94..b313f42 100644 --- a/docs/interfaces/_assertionlibraries_iexpectation_.iexpectation.html +++ b/docs/interfaces/_assertionlibraries_iexpectation_.iexpectation.html @@ -117,7 +117,7 @@

    notToBeEmpty

  • Returns void

    @@ -134,7 +134,7 @@

    toBeTrue

  • Returns void

    @@ -151,7 +151,7 @@

    toDeeplyInclude

  • Parameters

    @@ -174,7 +174,7 @@

    toEqual

  • Parameters

    @@ -197,7 +197,7 @@

    toInclude

  • Parameters

    diff --git a/docs/interfaces/_bottester_.ibottester.html b/docs/interfaces/_bottester_.ibottester.html index 69901c1..4459527 100644 --- a/docs/interfaces/_bottester_.ibottester.html +++ b/docs/interfaces/_bottester_.ibottester.html @@ -119,7 +119,7 @@

    checkSession

  • @@ -156,7 +156,7 @@

    runTest

  • @@ -178,7 +178,7 @@

    sendMessageToBot

  • @@ -217,7 +217,7 @@

    sendMessageToBotAndExpectSaveWithNoRespon
  • @@ -249,7 +249,7 @@

    sendMessageToBotIgnoringResponseOrder

  • @@ -281,7 +281,7 @@

    then

  • @@ -313,7 +313,7 @@

    wait

  • diff --git a/docs/interfaces/_bottester_.ioptionsmodifier.html b/docs/interfaces/_bottester_.ioptionsmodifier.html index 7f52afd..cbf246c 100644 --- a/docs/interfaces/_bottester_.ioptionsmodifier.html +++ b/docs/interfaces/_bottester_.ioptionsmodifier.html @@ -116,7 +116,7 @@

    addMessageFilter

  • @@ -147,7 +147,7 @@

    ignoreEndOfConversationEvent

  • @@ -169,7 +169,7 @@

    ignoreTypingEvent

  • @@ -191,7 +191,7 @@

    setTimeout

  • diff --git a/docs/interfaces/_config_.iconfig.html b/docs/interfaces/_config_.iconfig.html index 9767185..4ba3e5e 100644 --- a/docs/interfaces/_config_.iconfig.html +++ b/docs/interfaces/_config_.iconfig.html @@ -84,6 +84,7 @@

    Properties

    @@ -115,7 +116,7 @@

    Optional ignoreEndOf
    ignoreEndOfConversationEvent: boolean
    @@ -124,13 +125,28 @@

    Optional ignoreEndOf

    +
    + +

    Optional ignoreInternalSveMessage

    +
    ignoreInternalSveMessage: boolean
    + +
    +
    +

    ignores the internal save message. Setting this to true will cause checkSession to hang and test to fail

    +
    +
    +

    Optional ignoreTypingEvent

    ignoreTypingEvent: boolean
    @@ -145,7 +161,7 @@

    Optional messageFiltersmessageFilters: MessageFilter[]

    @@ -160,7 +176,7 @@

    Optional timeout

    timeout: number
    @@ -231,6 +247,9 @@

    Optional timeout

  • ignoreEndOfConversationEvent
  • +
  • + ignoreInternalSveMessage +
  • ignoreTypingEvent
  • diff --git a/docs/modules/_assertionlibraries_iexpectation_.html b/docs/modules/_assertionlibraries_iexpectation_.html index e765fec..08b7800 100644 --- a/docs/modules/_assertionlibraries_iexpectation_.html +++ b/docs/modules/_assertionlibraries_iexpectation_.html @@ -95,7 +95,7 @@

    expect

  • diff --git a/docs/modules/_bottester_.html b/docs/modules/_bottester_.html index 8b83c17..9357120 100644 --- a/docs/modules/_bottester_.html +++ b/docs/modules/_bottester_.html @@ -98,7 +98,7 @@

    checkSessionFunction

    checkSessionFunction: function
    diff --git a/docs/modules/_builtinmessagefilters_.html b/docs/modules/_builtinmessagefilters_.html index 8a181ac..2466f66 100644 --- a/docs/modules/_builtinmessagefilters_.html +++ b/docs/modules/_builtinmessagefilters_.html @@ -91,7 +91,7 @@

    ignoreEndOfConversationEventFilter

  • Parameters

    @@ -114,7 +114,7 @@

    ignoreInternalSaveMessageFilter

  • Parameters

    @@ -137,7 +137,7 @@

    ignoreTypingEventFilter

  • Parameters

    diff --git a/docs/modules/_config_.html b/docs/modules/_config_.html index ad8a36f..d9f0d01 100644 --- a/docs/modules/_config_.html +++ b/docs/modules/_config_.html @@ -98,7 +98,7 @@

    MessageFilter

    MessageFilter: function
    @@ -137,7 +137,7 @@

    NO_TIMEOUT

    NO_TIMEOUT: -1 = -1
    @@ -152,7 +152,7 @@

    config

    config: IConfig = configInternal
  • diff --git a/docs/modules/_expectedmessage_.html b/docs/modules/_expectedmessage_.html index 92b25f6..09fb72e 100644 --- a/docs/modules/_expectedmessage_.html +++ b/docs/modules/_expectedmessage_.html @@ -98,7 +98,7 @@

    PossibleExpectedMessageCollections

    PossibleExpectedMessageCollections: PossibleExpectedMessageType[]
    @@ -114,7 +114,7 @@

    PossibleExpectedMessageType

    PossibleExpectedMessageType: string | IMessage | RegExp | IEvent
    diff --git a/docs/modules/_messageservice_.html b/docs/modules/_messageservice_.html index 37b4d1d..8f87136 100644 --- a/docs/modules/_messageservice_.html +++ b/docs/modules/_messageservice_.html @@ -91,7 +91,7 @@

    botToUserMessageCheckerFunction

    botToUserMessageCheckerFunction: function
    diff --git a/package.json b/package.json index c5b2003..0104f7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bot-tester", - "version": "3.1.0", + "version": "3.2.0", "description": "Easily test bots made with the bot builder framework", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/config.ts b/src/config.ts index 744f1fd..954f2d0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,6 @@ import { IAddress, IMessage } from 'botbuilder'; import * as fs from 'fs'; +import { ignoreInternalSaveMessageFilter } from './builtInMessageFilters'; /** * Returns true if a message @@ -26,6 +27,12 @@ export interface IConfig { */ ignoreEndOfConversationEvent?: boolean; + /** + * ignores the internal __save__ message. Setting this to true will cause checkSession to hang and test to fail + */ + // this is explicitly not added as a chained builder function to disaude consumers from using this. + ignoreInternalSveMessage?: boolean; + /** * filters for messages that the BotTester framework should use */ @@ -56,4 +63,8 @@ if (configFileExists) { configInternal.messageFilters = []; +if (configInternal.ignoreInternalSveMessage) { + configInternal.messageFilters.push(ignoreInternalSaveMessageFilter); +} + export const config = configInternal; From 892b93effff338b5cb5c954021a15fcfc7fba69b Mon Sep 17 00:00:00 2001 From: Matt Schwartz Date: Tue, 10 Oct 2017 17:27:15 -0700 Subject: [PATCH 2/2] fixed spelling error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a41e10a..acecc2f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Passing in the config overrides any default values or values set by bot-tester.j ignoreTypingEvent: boolean, ignoreEndOfConversationEvent: boolean, // Setting this to true will cause checkSession to hang and test to fail. - ignoreInternalSveMessage?: boolean; + ignoreInternalSaveMessage?: boolean; } ```