counterfact
counterfact copied to clipboard
Start Counterfact from Code
The use case here is a Playwright test run (or some other E2E test setup) that needs to spin up Counterfact in order to run some tests.
Currently we handle this by having an npm script as the Playwright server script that starts both CF and the app engine (webpack dev server in our case). This is brittle and sometimes one or the other process doesn't start correctly. While that's likely something we could fix within the npm script setup, I see a case for being able to spin up Counterfact from within a test suite.
Absolutely. And expose the context objects so the tests can put the server into the state needed for testing.
Edit: I just saw #730. 💯