diff --git a/.github/workflows/file.yaml b/.github/workflows/file.yaml index 020d7a053..6adcf15f4 100644 --- a/.github/workflows/file.yaml +++ b/.github/workflows/file.yaml @@ -51,4 +51,4 @@ jobs: sdk: ${{ matrix.sdk }} - run: dart pub get - - run: dart pub run test -j1 + - run: dart test -j1 diff --git a/pkgs/coverage/test/test_with_coverage_test.dart b/pkgs/coverage/test/test_with_coverage_test.dart index 364510b4f..d27debea3 100644 --- a/pkgs/coverage/test/test_with_coverage_test.dart +++ b/pkgs/coverage/test/test_with_coverage_test.dart @@ -117,11 +117,11 @@ dependency_overrides: test('dart pub global run coverage:test_with_coverage', () async { final globalPub = - await _run(['pub', 'global', 'activate', '-s', 'path', _pkgDir]); + await _run(['dart', 'pub', 'global', 'activate', '-s', 'path', _pkgDir]); await globalPub.shouldExit(0); await _runTest( - ['pub', 'global', 'run', 'coverage:test_with_coverage'], + ['dart', 'pub', 'global', 'run', 'coverage:test_with_coverage'], ); }); diff --git a/pkgs/markdown/benchmark/input.md b/pkgs/markdown/benchmark/input.md index 2dd9df52a..827a3b99d 100644 --- a/pkgs/markdown/benchmark/input.md +++ b/pkgs/markdown/benchmark/input.md @@ -85,9 +85,9 @@ void main() { ## Running Tests -A single test file can be run just using `dart run test path/to/test.dart`. +A single test file can be run just using `dart test path/to/test.dart`. -Many tests can be run at a time using `dart run test path/to/dir`. +Many tests can be run at a time using `dart test path/to/dir`. It's also possible to run a test on the Dart VM only by invoking it using `dart path/to/test.dart`, but this doesn't load the full test runner and will be @@ -98,7 +98,7 @@ file. If you don't pass any paths, it will run all the test files in your `test/` directory, making it easy to test your entire application at once. By default, tests are run in the Dart VM, but you can run them in the browser as -well by passing `dart run test -p chrome path/to/test.dart`. +well by passing `dart test -p chrome path/to/test.dart`. `test` will take care of starting the browser and loading the tests, and all the results will be reported on the command line just like for VM tests. In fact, you can even run tests on both platforms with a single command: `dart run diff --git a/pkgs/markdown/benchmark/output.html b/pkgs/markdown/benchmark/output.html index 200e4bd22..3ee3a19d3 100644 --- a/pkgs/markdown/benchmark/output.html +++ b/pkgs/markdown/benchmark/output.html @@ -64,10 +64,10 @@

Real-world sample

}

Running Tests

-

A single test file can be run just using pub run test:test path/to/test.dart -(on Dart 1.10, this can be shortened to pub run test path/to/test.dart).

+

A single test file can be run just using dart test:test path/to/test.dart +(on Dart 1.10, this can be shortened to dart test path/to/test.dart).

Single file being run via pub run"

-

Many tests can be run at a time using pub run test:test path/to/dir.

+

Many tests can be run at a time using dart test:test path/to/dir.

Directory being run via "pub run".

It's also possible to run a test on the Dart VM only by invoking it using dart path/to/test.dart, but this doesn't load the full test runner and will be missing some features.

@@ -75,10 +75,10 @@

Running Tests

file. If you don't pass any paths, it will run all the test files in your test/ directory, making it easy to test your entire application at once.

By default, tests are run in the Dart VM, but you can run them in the browser as -well by passing pub run test:test -p chrome path/to/test.dart. +well by passing dart test:test -p chrome path/to/test.dart. test will take care of starting the browser and loading the tests, and all the results will be reported on the command line just like for VM tests. In -fact, you can even run tests on both platforms with a single command: pub run test:test -p "chrome,vm" path/to/test.dart.

+fact, you can even run tests on both platforms with a single command: dart test:test -p "chrome,vm" path/to/test.dart.

Restricting Tests to Certain Platforms

Some test files only make sense to run on particular platforms. They may use dart:html or dart:io, they might test Windows' particular filesystem diff --git a/pkgs/pubspec_parse/build.yaml b/pkgs/pubspec_parse/build.yaml index 2003bc29e..53ce450a4 100644 --- a/pkgs/pubspec_parse/build.yaml +++ b/pkgs/pubspec_parse/build.yaml @@ -1,5 +1,5 @@ # Read about `build.yaml` at https://pub.dev/packages/build_config -# To update generated code, run `pub run build_runner build` +# To update generated code, run `dart run build_runner build` targets: $default: builders: diff --git a/pkgs/timing/README.md b/pkgs/timing/README.md index 9dab7cc51..9bf84adb6 100644 --- a/pkgs/timing/README.md +++ b/pkgs/timing/README.md @@ -21,7 +21,7 @@ print('${tracker.duration} ${tracker.innerDuration} ${tracker.slices}'); Use the following command to re-generate `lib/src/timing.g.dart` file: ```bash -dart pub run build_runner build +dart run build_runner build ``` ## Publishing automation diff --git a/pkgs/yaml_edit/README.md b/pkgs/yaml_edit/README.md index f10560bfa..3727399eb 100644 --- a/pkgs/yaml_edit/README.md +++ b/pkgs/yaml_edit/README.md @@ -53,7 +53,7 @@ Testing is done in two strategies: Unit testing (`/test/editor_test.dart`) and Golden testing (`/test/golden_test.dart`). More information on Golden testing and the input/output format can be found at `/test/testdata/README.md`. -These tests are automatically run with `pub run test`. +These tests are automatically run with `dart test`. ## Limitations diff --git a/pkgs/yaml_edit/test/testdata/README.md b/pkgs/yaml_edit/test/testdata/README.md index 51452648b..c04a66447 100644 --- a/pkgs/yaml_edit/test/testdata/README.md +++ b/pkgs/yaml_edit/test/testdata/README.md @@ -15,8 +15,8 @@ When the tests are run (see [Running Tests](#Running-Tests)), the series of spec ## Running Tests -By default, golden testing is performed with `pub run test`. If we only wanted to -performed golden testing, simply do: `pub run test test/golden_test.dart`. +By default, golden testing is performed with `dart test`. If we only wanted to +performed golden testing, simply do: `dart test test/golden_test.dart`. ## Input Format