@@ -16,18 +16,18 @@ Tools
16
16
17
17
dart pub global activate coverage
18
18
19
- Consider adding the ` pub global run ` executables directory to your path.
19
+ Consider adding the ` dart pub global run` executables directory to your path.
20
20
See [ Running a script from your PATH] ( https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path )
21
21
for more details.
22
22
23
23
#### Collecting coverage from the VM
24
24
25
25
```
26
26
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN script.dart
27
- pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates
27
+ dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates
28
28
```
29
29
30
- or if the ` pub global run ` executables are on your PATH,
30
+ or if the ` dart pub global run` executables are on your PATH,
31
31
32
32
```
33
33
collect_coverage --uri=http://... -o coverage.json --resume-isolates
@@ -44,10 +44,10 @@ all isolates are paused before collecting coverage.
44
44
#### Formatting coverage data
45
45
46
46
```
47
- pub global run coverage:format_coverage --package=app_package -i coverage.json
47
+ dart pub global run coverage:format_coverage --package=app_package -i coverage.json
48
48
```
49
49
50
- or if the ` pub global run ` exectuables are on your PATH,
50
+ or if the ` dart pub global run` exectuables are on your PATH,
51
51
52
52
```
53
53
format_coverage --package=app_package -i coverage.json
@@ -70,15 +70,15 @@ collect_coverage:
70
70
71
71
```
72
72
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN script.dart
73
- pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --function-coverage
73
+ dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --function-coverage
74
74
```
75
75
76
76
To gather branch level coverage information, pass ` --branch-coverage ` to * both*
77
77
collect_coverage and the Dart command you're gathering coverage from:
78
78
79
79
```
80
80
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN --branch-coverage script.dart
81
- pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --branch-coverage
81
+ dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --branch-coverage
82
82
```
83
83
84
84
Branch coverage requires Dart VM 2.17.0, with service API v3.56. Function,
@@ -87,5 +87,5 @@ those flags:
87
87
88
88
```
89
89
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN --branch-coverage script.dart
90
- pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --function-coverage --branch-coverage
90
+ dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --function-coverage --branch-coverage
91
91
```
0 commit comments