Supports all Melos filtering flags.
This command runs the tests of all the local packages in your workspace that
have a test/ directory, in a single run. flutter test is used for the
packages that depend on the Flutter SDK and dart test is used for all the
other packages.
melos testPackages without a test/ directory are skipped. The command fails if the
tests of any of the packages fail, and the failing packages are listed in the
summary at the end of the run.
dart test and flutter test exit with the exit code 79 when no tests ran.
Melos treats this exit code as a success, so that packages without any tests to
run do not fail the command.
To learn more, visit the Dart testing documentation.
The defaults of the options below can be configured in the
command/test section of your root
pubspec.yaml file.
Defines the max concurrency value of how many packages will execute the command
in at any one time. Defaults to 1.
When the value is higher than 1 it is also passed on to dart test and
flutter test as --concurrency.
# Set a 5 concurrency
melos test -c 5Skips the implicit pub get that flutter test runs before testing a package,
by passing --no-pub to it. This has no effect on Dart-only packages, since
dart test does not support the flag.
melos test --no-pubSince the command supports all the Melos filtering flags, you can run the tests of a subset of your packages:
# Only run the tests of the packages that have changed since the main branch
melos test --diff=origin/main
# Only run the tests of the Flutter packages
melos test --flutter
