I'm experimenting with auto-generating outcomes using @xstate/test
and combining it with puppeteer and jest. Using jest's beforeAll and afterAll hooks I'm calling page.setRequestInterception
and registering a callback to intercept network requests and mock their response.
XState generates the pathways that I want to test and from each path I can determine whether the test wants to test what should occur when the API fails or succeeds. I'm stuck on how to properly communicate that back to puppeteer and access that information in my request handler.