bespoken / virtual-alexa

:robot: Easily test and debug Alexa skills programmatically

Home Page:https://bespoken.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support "open", "ask", "launch", "talk to" and "tell" for utterances

jkelvie opened this issue · comments

When running unit tests, any utterance that starts with these words should be automatically treated as a launch request.

Additionally, if it starts with these words, we should look for the pattern:
<ask|open|launch|talk to|tell> <invocation_name> to <utterance>

This can be turned into a regex like so:

/^(?:ask|open|launch|talk to|tell) .* to (.*)/i

If the regex matches, we use the captured part after the "to" as the utterance, to be fed to the utter method (as opposed to calling a launch request).

The goal of this change, BTW, is to allow for more readable tests - as well as ones that work for both unit and end-to-end testing.