dart-test-fundamentals

Teach Dart package:test fundamentals including test, group, and lifecycle methods.

139|16|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/kevmoo/dash_skills --skill dart-test-fundamentals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dart-test-fundamentals
Source: https://github.com/kevmoo/dash_skills/tree/main/.agent/skills/dart-test-fundamentals
Command: npx skills add https://github.com/kevmoo/dash_skills --skill dart-test-fundamentals

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a foundational understanding of Dart's package:test library, enabling developers to write robust and well-structured tests for their Dart and Flutter applications.

Core Features & Use Cases

  • Test Organization: Learn to use test and group for clear test structuring.
  • Lifecycle Management: Understand and implement setUp, tearDown, setUpAll, and tearDownAll for effective test setup and teardown.
  • Configuration: Discover how to configure test execution using dart_test.yaml for platforms, tags, and timeouts.
  • Use Case: When starting a new Dart project or refactoring existing tests, this skill guides you in setting up a maintainable and efficient testing suite.

Quick Start

Use the dart-test-fundamentals skill to create a new test file for the 'my_feature.dart' file.

Frequently Asked Questions about dart-test-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Dart tests using groups and test functions?

Structure Dart tests using the `group` function to organize related tests and the `test` function to define individual cases. This creates a clear, maintainable hierarchy for your Dart testing suite.

What do setUp and tearDown do in a Dart test suite?

`setUp` and `tearDown` manage test lifecycles by running code before and after each test. `setUpAll` and `tearDownAll` execute once for the entire group, ensuring a clean testing environment.

How do I configure Dart test execution for specific platforms and timeouts?

Configure Dart test execution by creating a `dart_test.yaml` file. This configuration file allows you to specify target platforms, define custom timeouts, and tag tests to control how they run.

Can I use package:test for testing Flutter applications?

Yes, `package:test` is the underlying framework for Flutter testing. Mastering its core concepts like test grouping and lifecycle management is essential for writing reliable tests for both Dart and Flutter applications.

What is the best way to start writing a unit test for a Dart file?

To start writing a unit test, use the dart-test-fundamentals skill to generate a new test file for your feature. It guides you in applying `package:test` best practices for robust test structuring.

When should I use dart_test.yaml instead of inline test configurations?

Use `dart_test.yaml` when you need to configure test execution globally across your Dart project. It centralizes platform targets, tags, and timeout settings, preventing repetitive inline configurations.