BrianMacIntosh / alexa-skill-test-framework

Framework for easy offline black-box testing of Alexa skills.
MIT License
62 stars 28 forks source link

Improvement: Allow debugging tests by printing the response #46

Open jerzy-wachowiak opened 5 years ago

jerzy-wachowiak commented 5 years ago

Allow switching off/on debugging tests by printing the response. Something based on ... console.log(response); var actualSay = response.response && response.response.outputSpeech ? response.response.outputSpeech.ssml : undefined; var actualReprompt = response.response && response.response.reprompt && response.response.reprompt.outputSpeech ? response.response.reprompt.outputSpeech.ssml : undefined; ... in ../node_modules/alexa-skill-test-framework/index.js

hoegertn commented 5 years ago

Sounds like a good idea. Do mind opening it again here: https://github.com/taimos/ask-sdk-test/

I am not sure this version is maintained anymore.

jerzy-wachowiak commented 5 years ago

I implemented it for me this way: if (currentItem.printsResponse == true) { console.log(JSON.stringify(response, null, 2)); } to be used like this alexaTest.test([ { request: alexaTest.getLaunchRequest(), says: 'Welcome to the Alexa Skills Kit, you can say hello!', reprompts: 'Welcome to the Alexa Skills Kit, you can say hello!', shouldEndSession: false, printsResponse: true } ]);