group, setUp, and tearDown
Organize tests and share fixtures.
Tests Multiply Fast
One feature soon needs many tests. Without structure, a file becomes a flat, hard-to-scan list. Organization keeps it readable. 📚
Meet group
A group bundles related tests under one label. Its output is indented, so suites read like an outline.
group('Cart', () {
test('starts empty', () { /* ... */ });
});All lessons in this course
- Your First test and expect
- group, setUp, and tearDown
- Testing async Code and Streams
- Mocks, Fakes, and Coverage