test-flutter
test-flutter automates testing workflows for Flutter apps, combining unit tests, widget tests, static analysis, and code formatting into a single execution flow. It provides structured test conventions for organizing tests by feature and separates logic verification from UI interaction testing.
test-flutter runs Flutter app tests alongside static analysis, formatting, and code quality checks.
AI-generated summary based on this skill's SKILL.md
Install
K9i-0/ccpocket/test-flutter · repository language: Dart
git clone https://github.com/K9i-0/ccpocket
cp -r ccpocket/.claude/skills/test-flutter ~/.claude/skills/test-flutterFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I run flutter tests with test-flutter?
test-flutter executes flutter test commands to run your app's unit and widget tests in an organized workflow. The skill automates test discovery, execution, and reporting across your test suite. It integrates static analysis checks so you can verify both functionality and code quality in a single pass, following Flutter testing conventions.
What does dart static analysis and formatting do in test-flutter?
test-flutter runs dart analyze to perform static code analysis and dart format to enforce code style compliance. These tools catch potential bugs, enforce linting rules, and ensure consistent Dart code formatting across your project. Running them together with your tests maintains code quality standards alongside functional verification.
How should I structure my flutter test files?
test-flutter follows Flutter conventions for test file organization: place tests in a test/ directory mirroring your lib/ structure, name test files with _test.dart suffix, and organize tests by feature. Separate widget tests (testing UI interactions) from logic tests (testing business logic). This structure keeps tests maintainable and discoverable.
What's the difference between widget and logic tests in test-flutter?
test-flutter distinguishes widget tests from logic tests: widget tests use testWidgets to verify UI behavior and user interactions, while logic tests verify business logic and data processing. Separating these concerns makes tests faster, more focused, and easier to maintain. test-flutter helps you write both types following Flutter best practices.
Can test-flutter help with dart linting and analysis?
Yes, test-flutter integrates dart analyze for static analysis and linting checks. It identifies code quality issues, potential bugs, and style violations before runtime. Combined with dart format for code formatting, test-flutter ensures your Dart codebase meets quality standards and follows established conventions.
What testing conventions does test-flutter enforce?
test-flutter automates testing workflows using Flutter conventions: organizing tests by feature, using _test.dart naming patterns, separating widget and logic tests, and running static analysis alongside functional tests. These conventions make your test suite scalable, maintainable, and aligned with Flutter community standards.
SKILL.md
rendered from the published skill — quoted content, verbatim
Flutter App テスト
実行手順
以下を順番に実行し、全てパスすることを確認する。
1. 静的解析
dart analyze apps/mobile
warning 以上は修正する。info レベルは必要に応じて対応。
MCP代替: mcp__dart-mcp__analyze_files でも実行可能だが、CLI推奨。
2. フォーマット
dart format apps/mobile
3. ユニットテスト
cd apps/mobile && flutter test
特定ファイルのみ:
cd apps/mobile && flutter test test/<filename>_test.dart
MCP代替: mcp__dart-mcp__run_tests でも実行可能だが、CLI推奨。
MCP版はDTD接続不要な操作のため、CLIの方が効率的。
テスト記述規約
ファイル配置・命名
- テストファイルは
apps/mobile/test/に配置 - 命名:
<対象の概念>_test.dart - ウィジェットテスト例:
approval_bar_test.dart,chat_input_bar_test.dart - ロジックテスト例:
chat_message_handler_test.dart
import
import 'package:flutter_test/flutter_test.dart';
import 'package:ccpocket/...';
テスト構造
```dart void main() { group('対象クラスまたは機能', () { test('動作の説明', () { // ロジックテスト expect(actual, expected); });
testWidgets('UI動作の説明', (tester) async {
// ウィジェットテスト
await
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
.claude/skills/test-flutter/SKILL.md