Open c-shultz opened 4 years ago
One approach that was discussed at our dev roundtable was to mock the connect server. This node-based mock REST server let's you define endpoints/responses with a JSON file: https://github.com/typicode/json-server. That may be a good one since we're already defining our mock responses in a JSON file.
I'm bumping this out of the milestone. It's a lower priority and we'll look at addressing it in the future.
Ideally, our test code would not need to touch the production code, but there's a flag check here to load the mocked API client:
https://github.com/Automattic/woocommerce-services/blob/6aa66d4f8087e15af19cba5026a6809e80c491a0/woocommerce-services.php#L645-L651