Skip to content

Commit

Permalink
Merge pull request #16 from VGVentures/alestiago/testing-tips
Browse files Browse the repository at this point in the history
docs: "Organize test files" testing tip
  • Loading branch information
jolexxa authored Jul 15, 2024
2 parents 032eca6 + 29022b5 commit 749ef03
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/content/docs/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ test/

> Note: `models.dart` and `widgets.dart` are barrel files and do not need to be tested.
:::tip
You can automatically create or find a test file when using the [Flutter VS Code Extension](https://docs.flutter.dev/tools/vs-code) by right-clicking on the file within the [explorer view](https://code.visualstudio.com/docs/getstarted/userinterface#_explorer-view) and selecting "Go to Tests" or using the ["Go to Test/Implementation File"](https://github.com/Dart-Code/Dart-Code/blob/09cb9828b7b315d667ee5dc97e9287a6c6c8655a/package.json#L323) command within the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).
:::

:::note
You can find more information about package layouts in the [Dart Package layout conventions](https://dart.dev/tools/pub/package-layout) and in [What makes a package](https://dart.dev/guides/libraries/create-packages#what-makes-a-package).
:::

## Assert test results using expect or verify

All tests should have one or more statements at the end of the test asserting the test result using either an [expect](https://api.flutter.dev/flutter/flutter_test/expect.html) or [verify](https://pub.dev/documentation/mocktail/latest/).
Expand Down

0 comments on commit 749ef03

Please sign in to comment.