Skip to content

Commit 8590bda

Browse files
authored
[camera_android_camerax] Add magic number guideline to TESTING.md (flutter#13081)
To improve agent-author test clarity, adds testing guidance for agents regarding asserting against number literal without explanation or instead of a variable unnecessarily. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent e3af8f9 commit 8590bda

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎packages/camera/camera_android_camerax/TESTING.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This document outlines testing rules and best practices for the `camera_android_camerax` package. All contributors MUST follow these guidelines to prevent CI flakiness and maintain code quality.
44

5+
## General Guidelines
6+
7+
- **No Magic Numbers in Assertions**: Avoid unexplained numeric literals in `expect()` (e.g., `equals(5.0)`). Use variables derived from test inputs (e.g., `final expectedOffset = index * stepSize;`) or add a brief comment explaining the calculation.
8+
59
## Integration Tests
610

711
- **Video Recording Delay**: You MUST add a delay of at least 4 seconds (e.g., `await Future<void>.delayed(const Duration(seconds: 4));`) before stopping a video recording.

0 commit comments

Comments
 (0)