Skip to content

Commit d5ca8ba

Browse files
committed
doc: update docs for skip_very_good_optimization tag
1 parent eedf947 commit d5ca8ba

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

lib/src/commands/dart/commands/dart_test_command.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ class DartTestCommand extends Command<int> {
150150
defaultsTo: true,
151151
help:
152152
'Whether to apply optimizations for test performance. '
153-
'Automatically disabled when --platform is specified.',
153+
'Automatically disabled when --platform is specified. '
154+
'''Add the `skip_very_good_optimization` tag to specific test files to disable them individually.''',
154155
)
155156
..addOption(
156157
'concurrency',

lib/src/commands/test/test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ class TestCommand extends Command<int> {
164164
defaultsTo: true,
165165
help:
166166
'Whether to apply optimizations for test performance. '
167-
'Automatically disabled when --platform is specified.',
167+
'Automatically disabled when --platform is specified. '
168+
'''Add the `skip_very_good_optimization` tag to specific test files to disable them individually.''',
168169
)
169170
..addOption(
170171
'concurrency',

site/docs/commands/test.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ very_good test [arguments]
1717
-r, --recursive Run tests recursively for all nested packages.
1818
--[no-]optimization Whether to apply optimizations for test performance.
1919
(defaults to on)
20+
Add the `skip_very_good_optimization` tag to specific test files to disable them individually.
2021
-j, --concurrency The number of concurrent test suites run.
2122
(defaults to "4")
2223
-t, --tags Run only tests associated with the specified tags.
@@ -61,3 +62,13 @@ Golden tests are tests that compare the output of a test to a "golden" file. If
6162
[Very Good CLI](https://cli.vgv.dev/) supports golden tests out of the box, with and without a custom [`goldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/goldenFileComparator.html). This means that **no change is required** to your test code to run them with `very_good test`.
6263

6364
:::info For an example on specifying a custom [`GoldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/GoldenFileComparator-class.html) that accepts a certain amount of difference (toleration threshold), refer to the [`goldenFileComparator` Flutter documentation](https://api.flutter.dev/flutter/flutter_test/goldenFileComparator.html). :::
65+
66+
### Skip optimization for specific tests
67+
68+
By default, all tests run with optimizations enabled; use the `--no-optimization` flag to disable globally, or add the `skip_very_good_optimization` tag to specific test files to disable them individually.
69+
70+
```
71+
@Tags(['skip_very_good_optimization'])
72+
73+
import 'package:test/test.dart';
74+
```

0 commit comments

Comments
 (0)