antoinechalifour/memento

Programmatic interface for integration tests usage

Closed this issue · 0 comments

As of today, Memento can be used for stubbing external services in integration tests, but Memento has to be run manually outside the test suite, and the cache-location is shared with the dev environment.

This can be improved. The ideal integration would be to setup Memento in a beforeAll hook (assuming an API similar to jest), and kill Memento in an afterAll hook.

To provide this integration, the following must be done :

  • export memento not as a CLI binary but as a Node module
  • provide a new option for customizing the cache directory (.memento-cache at the moment). For instance, users could decide to cache requests in memento-integration and decide to track this file in the VCS