← ClaudeAtlas

testing-conventionslisted

GM testing patterns — modular (per-package tests, Failure mocking) vs non-modular (Result helpers), bloc_test, mocktail for Flutter + Clean Architecture
ghozimahdi/gm-aiagent-plugins · ★ 0 · Testing & QA · score 67
Install: claude install-skill ghozimahdi/gm-aiagent-plugins
Resolve `UFIL_ROOT` to the plugin root containing this skill. Claude Code may provide `CLAUDE_PLUGIN_ROOT`; Codex can resolve it from the installed skill path. ## Testing Conventions (GM Standard) ### Directory Structure #### Non-Modular ``` test/features/<feature>/ ├── data/ # repository_impl_test.dart, dto_test.dart ├── domain/ # usecase_test.dart └── presentation/ # bloc_test.dart ``` #### Modular — per-package `test/` ``` packages/ ├── domain/domain_<feature>/ │ └── test/ │ ├── models/ # model_test.dart │ ├── usecases/ # usecase_test.dart │ └── helpers/ │ └── test_data.dart ├── data/data_<feature>/ │ └── test/ │ ├── datasources/ # datasource_test.dart │ ├── models/ # dto_test.dart │ ├── repositories/ # repository_impl_test.dart │ └── helpers/ │ └��─ test_data.dart └── presentation/feature_<feature>/ └── test/ ├── blocs/ # bloc_test.dart └── helpers/ └── test_data.dart ``` Each package has its own `test/` directory. Shared test utilities (e.g. mock factories, common fixtures) go in a dedicated `test/helpers/` within each package. --- ### Bloc Test Pattern #### Non-Modular — Result helpers ```dart import 'package:bloc_test/bloc_test.dart'; import 'package:mocktail/mocktail.dart'; class MockGetTenantsUsecase extends Mock implements GetTenantsUsecase {} void main() { late MockGetTenantsUsecase mockUsecase; late