actions-on-google / actions-on-google-testing-nodejs

Apache License 2.0
75 stars 18 forks source link

Avoid cancel when mic closed #52

Closed adamcohenrose closed 4 years ago

adamcohenrose commented 4 years ago

It appears that AoG has changed how it behaves when given input outside of the action. Previously it would ignore that input and leave the conversation closed. Now it appears to open a new conversation which confuses the tests.

Consequently, always saying "cancel" after every test will cause problems when there are multiple tests in a single file.

This PR detects when the mic is closed and skips saying "cancel" if so.

Another change that appears to have happened to AoG is that the debug_info content is no longer being returned. This means that much of the content (including the previous flag for the microphone being closed!) is no longer available.

This PR grabs the microphone_mode value from the dialog_state_out which is still returned to discover if the mic has been closed.

Additional changes in this PR

Added a prepare lifecycle step to package.json so that the project can be used as a dependency straight from a github branch.

Fleker commented 4 years ago

Thanks!