Feature Proposal: Same-process testing


#1

Currently, Jovo’s unit tests run in one process, while the app runs in another process. This has a few drawbacks:

I’m proposing to update the Conversation class so a request can be sent directly to the Jovo app under test. The test could import the app directly, and pass both the request and the app into a new send method that returns a JovoResponse object, but without the http communication to a separate server process. Before sending the request, any HTTP requests could be intercepted and mocked with a module like Nock.


Unit Testing - Mocking API Calls
Unit testing your plugins
pinned globally #2

#3

Thank you @Stephen_Wilcox, I think this is a great idea!


#4

I vote for this idea also! While the coverage is a nice to have, the mocking is more important in my situation. I have several API or request calls that will need mocked once I get to these tests.