# jackin-test-support (https://jackin.tailrocks.com/reference/crates/jackin-test-support/)



{/* GENERATED from crates/jackin-test-support/README.md — edit the README, not this file */}

Canonical fakes and role-repo seed helpers shared across jackin❯ workspace test suites — extracted so that `jackin-isolation` no longer had to dev-depend back up on `jackin-runtime` just to reach `FakeRunner`/`FakeDockerClient` (the workspace's only prod+dev dependency cycle).

## What this crate owns [#what-this-crate-owns]

* `FakeRunner` — an in-memory `jackin_core::CommandRunner` fake for subprocess injection.
* `FakeDockerClient` — an in-memory `jackin_core::DockerApi` fake.
* `seed_valid_role_repo` / `first_temp_role_repo` / `TEST_DOCKERFILE_FROM` — minimal valid role-repo fixtures for tests exercising `validate_role_repo` and role-registration temp-dir discovery.

## Architecture tier and allowed dependencies [#architecture-tier-and-allowed-dependencies]

Test-support tier: sits just above `jackin-core`. Allowed workspace dependencies: `jackin-core`, `jackin-manifest` (both leaf/domain crates that do not depend on this crate or on `jackin-runtime`). &#x2A;*Production crates must never depend on this crate — it is consumed via `[dev-dependencies]` only.** Anyone's dev-deps may depend on it; it may depend only downward itself.

## Structure [#structure]

| Module                                                                           | Owns                    | Tests |
| -------------------------------------------------------------------------------- | ----------------------- | ----- |
| <RepoFile path="crates/jackin-test-support/src/lib.rs">`lib.rs`</RepoFile>       | crate root, re-exports  | —     |
| <RepoFile path="crates/jackin-test-support/src/runner.rs">`runner.rs`</RepoFile> | `FakeRunner`            | —     |
| <RepoFile path="crates/jackin-test-support/src/docker.rs">`docker.rs`</RepoFile> | `FakeDockerClient`      | —     |
| <RepoFile path="crates/jackin-test-support/src/seed.rs">`seed.rs`</RepoFile>     | role-repo seed fixtures | —     |

## Public API [#public-api]

`FakeRunner`, `FakeDockerClient`, `seed_valid_role_repo`, `first_temp_role_repo`, `TEST_DOCKERFILE_FROM` — all re-exported from the crate root. Moved byte-for-byte (behavior-preserving) from `jackin-runtime`'s former `runtime::test_support` module; `jackin-runtime`'s `install_all_test_stubs` stayed behind (it needs `jackin_image` and has no consumer outside `jackin-runtime`'s own tests).

## Dedupe candidates (follow-up, not done here) [#dedupe-candidates-follow-up-not-done-here]

Three fakes duplicate these types elsewhere in the workspace and were deliberately left in place by this extraction (different call sites, different plan):

* <RepoFile path="crates/jackin/tests/common.rs">crates/jackin/tests/common.rs</RepoFile> — its own `FakeRunner`.
* <RepoFile path="crates/jackin-host/src/caffeinate/tests.rs">crates/jackin-host/src/caffeinate/tests.rs</RepoFile> — its own `FakeDockerClient` + `FakeRunner`.
* Console `StubRunner`s (×4) — different trait, not a candidate.

Future Phase 3 test-support helpers (deterministic builders, snapshot normalization, fixed dims/theme, a `ManualClock` re-export) land here too, one PR each.

## How to verify [#how-to-verify]

```sh
cargo nextest run -p jackin-test-support
cargo clippy -p jackin-test-support --all-targets -- -D warnings
cargo tree -p jackin-test-support -i --edges normal   # inverse tree: no production crate should list it
```
