The way my Google Home app is organizaed is a class containing all intent methods and then
at the bottom a line
exports.myapp = functions.https.onRequest(
(request, response) => new MyApp(request, response).run()
);
Since the functions in MyApp
depend on request
to get parameters from, I assume a unit test has to have a faked input request
correct?
From the Actions On Google simulator, I've been able to get requests, but I'm not sure how to fake the response for the response
parameter to `MyApp constructor, especially since the returning thing from Actions on Google seems to be after running my actual code.
All of the following would be helpful: generic code snippets, links to test files/cases, request
/response
constructor arguments, etc.
Thank you!