dart-test-fundamentals — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dart-test-fundamentals (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill when:
group.dart_test.yaml.To find candidates for improving test structure:
try-finally CleanupSearch for tests that use try-finally for cleanup instead of addTearDown:
\bfinally\s*\{ (Check if this is used for resource cleanupinside a test).
test and group) test('description', () {
// assertions
});setUp and tearDown calls.PascalCase for groups that correspond to a class name(e.g., group('MyClient', ...)).
group call if it's the only one.
didn't create unless explicitly asked to. This can cause a LOT of churn in the DIFF that most engineers won't want!
test('test name here',:group instead.'throws StateError' or 'adds API key to URL').
test and group calls, place named parameters (e.g., testOn,timeout, skip) immediately after the description string, before the callback closure. This improves readability by keeping the test logic last.
test('description', testOn: 'vm', () {
// assertions
});setUp, tearDown)test in the current group (and nestedgroups).
test in the current group.Best Practice:
setUp for resetting state to ensure test isolation.test body, consider usingaddTearDown instead of a try-finally block.
Avoid:
test('can create and delete a file', () {
final file = File('temp.txt');
try {
file.writeAsStringSync('hello');
expect(file.readAsStringSync(), 'hello');
} finally {
if (file.existsSync()) file.deleteSync();
}
});Prefer:
test('can create and delete a file', () {
final file = File('temp.txt');
// Register teardown immediately after resource creation intent
addTearDown(() {
if (file.existsSync()) file.deleteSync();
});
file.writeAsStringSync('hello');
expect(file.readAsStringSync(), 'hello');
});dart_test.yaml)The dart_test.yaml file configures the test runner. Common configurations include:
#### Platforms Define where tests run (vm, chrome, node).
platforms:
- vm
- chrome#### Tags Categorize tests to run specific subsets.
tags:
integration:
timeout: 2xUsage in code:
@Tags(['integration'])
import 'package:test/test.dart';Running tags: dart test --tags integration
#### Timeouts Set default timeouts for tests.
timeouts:
2x # Double the default timeout_test.dart to be picked up by the test runner.test/ directory.dart test: Run all tests.dart test test/path/to/file_test.dart: Run a specific file.dart test --name "substring": Run tests matching a description.dart-test-fundamentals is the core skill for structuring and configuring tests. For writing assertions within those tests, refer to:
Use this if the project sticks with the traditional package:matcher (expect calls).
[dart-matcher-best-practices]: https://github.com/kevmoo/dash_skills/blob/main/skills/dart-matcher-best-practices/SKILL.md
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.