test
dart run stackchain test authdart run stackchain test auth --type unit,widgetdart run stackchain test auth --type integration --overwritedart run stackchain test --allFeature must already exist in stackchain.yaml.
What it generates
Section titled “What it generates”| Type | Output |
|---|---|
unit |
state tests — e.g. test/features/auth_bloc_test.dart |
widget |
page smoke — test/features/auth_page_test.dart |
integration |
flow smoke — integration_test/auth_flow_test.dart |
Default --type is all three.
Also creates once (never overwritten):
test/features/<feature>_custom_test.dartPut tests for your methods there.
Stub custom methods
Section titled “Stub custom methods”Scan // <stackchain:custom> and append failing placeholder tests to *_custom_test.dart:
dart run stackchain stub authdart run stackchain stub --alltest also stubs by default (--stub-custom; use --no-stub-custom to skip).
Options
Section titled “Options”| Flag | Meaning |
|---|---|
--type, -t |
unit, widget, integration (comma-separated) |
--all, -a |
Every feature in stackchain.yaml |
--overwrite, -f |
Refresh scaffold files (custom_test untouched) |
--stub-custom |
Stub custom methods (default on; --no-stub-custom) |
--dry-run |
Preview only |
--skip-analyze |
Skip analyzer in the quality check |
Safe refresh
Section titled “Safe refresh”Scaffold tests use // <stackchain:generated> regions — hand-written tests outside those markers survive a refresh.
Presentation classes (Bloc / Cubit / Page) use // <stackchain:custom> for your methods — see Your code stays safe.
feature auth still adds a default unit test. Use test for the full suite, or to refresh after a migrate.