Update CONTRIBUTING.md

Add single file testing
This commit is contained in:
Ankit Mahato
2023-07-20 05:17:34 +05:30
committed by GitHub
parent e77747df30
commit c016c2ed95

View File

@ -151,6 +151,20 @@ To view the coverage report in the browser for further analysis, execute:
open coverage/html/index.html
```
#### Testing a single file
To run tests specified in a single file, execute the following command:
```
flutter test --enable-experiment=records <file_path>.dart
```
Example:
```
flutter test --enable-experiment=records test/widgets/codegen_previewer_test.dart
```
### How to add a new package to pubspec.yaml?
Instead of copy pasting from pub.dev, it is recommended that you use `flutter pub add package_name` to add a new package to `pubspec.yaml`. You can read more [here](https://docs.flutter.dev/packages-and-plugins/using-packages#adding-a-package-dependency-to-an-app-using-flutter-pub-add).