simile test owns the emulator for the lifetime of one test command. It binds the service first,
passes its address to the child process, waits for the child, and shuts the emulator down. The
command returns the child’s exit code.
./Simfile, chooses an available loopback port, and sets SIMILE_BASE_URL for
npm test. The same pattern works with any test runner:
Test a registered service
Name a registered service when the test project does not contain its Simfile:simile test still selects an available port
for the supervised run. Pass --port when a test framework requires a fixed address:
Supply a caller profile
Set up a profile once, then inject it into the test process:SIMILE_BASE_URL, containing the address bound for this run;SIMILE_SERVICE, containing the service name;SIMILE_PROFILEandSIMILE_PRINCIPAL; and- every value issued by setup, using its uppercase environment name such as
API_KEY.
--profile is omitted, a registered service’s current profile is used when one exists.
Simile keeps issued values out of its status output.
Exercise controlled failures
A scenario selects one documented business case for the complete run:Choose the state boundary
The service state lives underSIMILE_HOME. A stable directory lets later runs continue from the
same resources and profiles:
SIMILE_HOME; a durable service database has one writer.
Keep the service running
Usesimile start when a developer, browser, or separately managed test process needs a stable
address:
Continue
- Open the console to follow the exchanges and state produced by a test.
- Run in CI to move the same lifecycle into an isolated pipeline job.
- Use GitHub Actions or Docker for concrete environment setup.
- Run a conformance suite when several exact reproductions form one gate.