원클릭으로
unit-test-generator
Generates unit tests for Clean Architecture components using Mockito and BlocTest.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generates unit tests for Clean Architecture components using Mockito and BlocTest.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Safely adds new translation keys to both English and French localization files.
Generates the folder structure and boilerplate code for a new feature using Clean Architecture, BLoC, and Freezed.
Comprehensive guidelines for reviewing Flutter code in the YouDown project, focusing on Bloc, performance, and best practices.
Guidelines for generating valid FFmpeg commands for the mobile FFmpeg Kit.
| name | Unit Test Generator |
| description | Generates unit tests for Clean Architecture components using Mockito and BlocTest. |
Use this skill when asked to "write tests" or "test this feature".
Target: lib/features/<feature>/presentation/bloc/<feature>_bloc.dart
Output: test/features/<feature>/presentation/bloc/<feature>_bloc_test.dart
Template:
import 'package:bloc_test/bloc_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:mockito/annotations.dart';
// Generate mocks
@GenerateMocks([FeatureUseCase])
import 'feature_bloc_test.mocks.dart';
void main() {
late FeatureBloc bloc;
late MockFeatureUseCase mockUseCase;
setUp(() {
mockUseCase = MockFeatureUseCase();
bloc = FeatureBloc(useCase: mockUseCase);
});
blocTest<FeatureBloc, FeatureState>(
'emits [Loading, Loaded] when Event is added',
build: () {
when(mockUseCase.call(any)).thenAnswer((_) async => Right(data));
return bloc;
},
act: (bloc) => bloc.add(const FeatureEvent.started()),
expect: () => [
const FeatureState.loading(),
const FeatureState.loaded(data),
],
);
}
Target: lib/features/<feature>/data/repositories/<feature>_repository_impl.dart
Output: test/features/<feature>/data/repositories/<feature>_repository_impl_test.dart
Strategy:
RemoteDataSource.repository.getData() calls dataSource.getData().dart run build_runner build --delete-conflicting-outputs to generate the mock files.