Skip to content

Commit

Permalink
doc(readme): add melos doc
Browse files Browse the repository at this point in the history
  • Loading branch information
giboin committed Jul 4, 2024
1 parent 2d2d528 commit 622e33c
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,36 @@ Out of the box, on each pull request and push, the CI `formats`, `lints`, and `t

## Running Tests 🧪

To run all unit tests:
This project uses [melos][melos_link] for convenience scripts such as running tests and coverage. All of these scripts can be run from any directory in the project, and are defined in the root `melos.yaml` file.

To activate melos, run the following command:

```sh
dart pub global activate melos
```

After that, to run all unit tests:

```sh
melos test
```

To run all tests and generate coverage report:

```sh
dart pub global activate coverage 1.2.0
dart test --coverage=coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info
melos test:cov
```

To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov).
To view the generated coverage report using [lcov][lcov_link] in your browser, run:

```sh
# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/
melos open:cov
```

If you want to reproduce the CI analyze job locally, you can run:

# Open Coverage Report
open coverage/index.html
```sh
melos analyze
```

[dart_install_link]: https://dart.dev/get-dart
Expand All @@ -60,3 +74,5 @@ open coverage/index.html
[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only
[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only
[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows
[lcov_link]: https://github.com/linux-test-project/lcov
[melos_link]: https://melos.invertase.dev/

0 comments on commit 622e33c

Please sign in to comment.