Currently, Jovo’s unit tests run in one process, while the app runs in another process. This has a few drawbacks:
- Requires separate step of starting the server.
- Inability to mock HTTP requests.
- Test coverage doesn’t work.
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.