원클릭으로
create-test
Process for creating unit and widget tests in the test/ directory mirroring the lib/src/ directory structure. Covers using Mockito.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Process for creating unit and widget tests in the test/ directory mirroring the lib/src/ directory structure. Covers using Mockito.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Process for creating mock data sources in the infrastructure layer.
Process for building, exporting, and registering reusable UI components in the packages/app_ui package. References design-to-code.md for design tokens (typography, colors, spacing).
Outlines the process for converting Figma designs into a structured, platform-aware Flutter implementation.
Use when completely removing the web platform from the project. Details how to delete directories/configurations, clean up app_ui web components, remove web-specific feature views (*_view_web.dart), prune conditional imports/logic, and run validation.
Use when asked to add, update, or group routes using GoRouter, or manage redirection guards.
Step-by-step workflow for creating, configuring, and updating Flutter golden tests using the Alchemist package.
| name | create-test |
| description | Process for creating unit and widget tests in the test/ directory mirroring the lib/src/ directory structure. Covers using Mockito. |
This skill defines the process for writing and running unit and widget tests in the project.
Test files must mirror the lib/src/ directory hierarchy under test/:
lib/src/
└── infrastructure/
└── auth/
└── auth_repository.dart
test/src/
└── infrastructure/
└── auth/
└── auth_repository_test.dart
All test files must end with the _test.dart suffix.
mockito package for mocking infrastructure and
external client dependencies.@GenerateMocks to auto-generate mocks
using build_runner.Annotate your test file's main() method with the dependencies to mock:
import 'package:apple_project/src/infrastructure/auth/auth_repository.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
// Import the generated mock file (ends with .mocks.dart)
import 'auth_repository_test.mocks.dart';
@GenerateMocks([AuthRepository])
void main() {
// Test code goes here
}
To build/generate the mock implementation, run:
melos run generate
Structure tests logically using group, test, and standard Mockito APIs:
void main() {
late MockAuthRepository mockAuthRepo;
setUp(() {
mockAuthRepo = MockAuthRepository();
});
group('AuthRepository Tests', () {
test('login returns success on correct credentials', () async {
// Arrange
when(mockAuthRepo.login('user', 'pass'))
.thenAnswer((_) async => const Ok(null));
// Act
final result = await mockAuthRepo.login('user', 'pass');
// Assert
expect(result.isOk, isTrue);
verify(mockAuthRepo.login('user', 'pass')).called(1);
});
});
}
flutter test
flutter test test/src/infrastructure/auth/auth_repository_test.dart