-
-
Notifications
You must be signed in to change notification settings - Fork 0
Development
albertoodev edited this page Aug 24, 2026
·
4 revisions
dart pub get # Install dependencies
dart analyze # Lint
dart test # Run all tests
dart test test/features/analysis/build_tree_metrics_test.dart # Run a single test file
dart test --name "extracts await-related features" # Run tests matching a name-
test/features/analysis/holds integration-style tests that exercise real Dart files through theanalyzer. Fixtures live intest/fixtures/analysis/(~20 realistic Dart source files). When adding an extractor or visitor, add a corresponding fixture and test here. -
test/features/analysis/utils/test_helper.dartprovidesgetResultsForFixture(relativePath). Prefer it over re-wiring the analysis pipeline in each test. -
test/features/isolation/holds tests for the isolation pipeline. Fixtures intest/fixtures/isolation/cover builder patterns, external deps, and runnable targets.test/fixtures/isolation_third_party/ui_kit/is a small package that sits outside the project on purpose, so the third-party gate actually fires; the suites that use it build a throwaway project at run time throughtest/features/isolation/utils/temp_project.dart, because a checked-in file importingpackage:ui_kitresolves for nobody and reads as an undeclared dependency. -
test/features/validation/holds tests for the validate gate. Fixtures intest/fixtures/validation/<case>/{base.dart, mutation.dart}, where each case proves one expected violation code. Run withdart test test/features/validation/.
- Use hand-written fakes only, never mocks. Implement the repository/data-source interface directly.
- Repository fakes expose
givenSuccess()/givenFailure(Failure); data-source fakes exposegivenSuccess()/givenThrows(Exception). - When capturing call arguments in a fake, copy list references:
List.of(targets). - Async exception tests must be
asyncandawaitthe call inside atry/catch. - For file-I/O tests, use
Directory.systemTemp.createTempSync(...)insetUpand delete intearDown. - When testing through the DI layer, call the relevant DI class's
reset()insetUp/tearDownto clear singletons.
- Use the type aliases in
src/core/types.dart(Result<T>,AsyncResult<T>,JsonRecord); never spell out the full types inline. - Return
Either<Failure, T>in data/domain layers; throw only at the outermost CLI boundary. - Log through
SpmLogger, neverprint.
See Architecture for the full layer and error-handling model.
Commands
Reference
Internals
Contributing