File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,31 @@ The setup script will:
31
31
- Initialize Husky for git hooks (if present)
32
32
- Add ` .fvm/ ` to ` .gitignore ` if needed
33
33
34
+ ## Testing
35
+
36
+ ### Local Testing
37
+
38
+ Run tests with coverage locally:
39
+
40
+ ``` bash
41
+ # Using the provided script (recommended)
42
+ ./scripts/test_with_coverage.sh
43
+
44
+ # Or manually
45
+ fvm flutter test --coverage
46
+ lcov --summary coverage/lcov.info
47
+ genhtml coverage/lcov.info -o coverage/html
48
+ open coverage/html/index.html
49
+ ```
50
+
34
51
## Contributing
35
52
36
53
Contributions are welcome! Please:
37
54
38
55
- Follow the existing code style and patterns
39
56
- Write clear commit messages (Commitlint and Husky are enabled)
40
57
- Add or update tests for new features or bug fixes
58
+ - Ensure all tests pass before submitting a pull request
41
59
- Open a pull request with a clear description
42
60
43
61
## License
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Flutter Policy Engine - Test with Coverage Script
4
+ # This script runs all tests and generates coverage reports
5
+
6
+ set -e # Exit on any error
7
+
8
+ echo " 🧪 Running Flutter tests with coverage..."
9
+
10
+ # Run tests with coverage
11
+ fvm flutter test --coverage
12
+
13
+ echo " 📊 Generating coverage summary..."
14
+ lcov --summary coverage/lcov.info
15
+
16
+ echo " 🌐 Generating HTML coverage report..."
17
+ genhtml coverage/lcov.info -o coverage/html
18
+
19
+ echo " ✅ Coverage report generated successfully!"
20
+ echo " 📁 HTML report available at: coverage/html/index.html"
21
+
22
+ # Open the coverage report in browser (macOS)
23
+ if [[ " $OSTYPE " == " darwin" * ]]; then
24
+ echo " 🔗 Opening coverage report in browser..."
25
+ open coverage/html/index.html
26
+ else
27
+ echo " 📖 To view the coverage report, open: coverage/html/index.html"
28
+ fi
29
+
30
+ echo " 🎉 Test coverage process completed!"
You can’t perform that action at this time.
0 commit comments